MCPcopy Create free account
hub / github.com/codecombat/codecombat / compile

Method compile

app/models/LevelComponent.js:77–90  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

75 }
76
77 compile (code) {
78 let js
79 if (this.get('codeLanguage') && (this.get('codeLanguage') === 'javascript')) { return code }
80 if (this.get('codeLanguage') && (this.get('codeLanguage') !== 'coffeescript')) {
81 return console.error('Can\'t compile', this.get('codeLanguage'), '-- only CoffeeScript/JavaScript.', this)
82 }
83 try {
84 js = CoffeeScript.compile(code, { bare: true })
85 } catch (e) {
86 console.log('couldn\'t compile', code, 'for', this.get('name'), 'because', e)
87 js = this.get('js')
88 }
89 return js
90 }
91
92 getDependencies (allComponents) {
93 const results = []

Callers 2

setMethod · 0.95
onLoadedMethod · 0.95

Calls 3

logMethod · 0.80
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected