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

Method set

app/models/CocoModel.js:139–153  ·  view source on GitHub ↗
(attributes, options)

Source from the content-addressed store, hash-verified

137 }
138
139 set (attributes, options) {
140 if (attributes !== 'thangs') { delete this.attributesWithDefaults } // unless attributes is 'thangs': performance optimization for Levels keeping their cache.
141 const inFlux = this.loading || !this.loaded
142 if (!inFlux && !this._revertAttributes && !this.project && !(options != null ? options.fromMerge : undefined)) { this.markToRevert() }
143 if (_.isString(attributes) && ((attributes === 'undefined') || (attributes === undefined))) {
144 console.error(`Blocking setting of ${attributes} property to ${this.constructor.className} model with value ${options}`)
145 return
146 } else if (_.isObject(attributes) && ('undefined' in attributes)) {
147 console.error(`Blocking setting of \`undefined\` property key to ${this.constructor.className} model with value ${attributes.undefined}`)
148 delete attributes.undefined
149 }
150 const res = super.set(attributes, options)
151 if (this.saveBackups && (!inFlux)) { this.saveBackup() }
152 return res
153 }
154
155 buildAttributesWithDefaults () {
156 const t0 = new Date()

Callers 15

loadFromBackupMethod · 0.95
revertMethod · 0.95
publishMethod · 0.95
populateI18NMethod · 0.95
updateI18NCoverageMethod · 0.95
karma.conf.jsFile · 0.45
server_setup.jsFile · 0.45

Calls 3

markToRevertMethod · 0.95
saveBackupMethod · 0.95
errorMethod · 0.45

Tested by 3

makeBranchFunction · 0.36
makeLevelsFunction · 0.36