MCPcopy Index your code
hub / github.com/codecombat/codecombat / applyDelta

Method applyDelta

app/views/editor/PatchModal.js:56–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 }
55
56 applyDelta () {
57 this.headModel = null
58 if (this.targetModel.hasWriteAccess()) {
59 this.headModel = this.originalSource.clone(false)
60 this.headModel.markToRevert(true)
61 this.headModel.set(this.targetModel.attributes)
62 this.headModel.loaded = true
63 }
64
65 this.pendingModel = this.originalSource.clone(false)
66 this.pendingModel.markToRevert(true)
67 this.deltaWorked = modelDeltas.applyDelta(this.pendingModel, this.patch.get('delta'))
68 return this.pendingModel.loaded = true
69 }
70
71 render () {
72 if (this.supermodel.finished()) { this.applyDelta() }

Callers 4

renderMethod · 0.95
acceptPatchMethod · 0.45
initializeMethod · 0.45
initializeMethod · 0.45

Calls 5

hasWriteAccessMethod · 0.80
markToRevertMethod · 0.80
cloneMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected