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

Method compile

app/models/LevelSystem.js:42–55  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

40 }
41
42 compile (code) {
43 let js
44 if (this.get('codeLanguage') && (this.get('codeLanguage') === 'javascript')) { return code }
45 if (this.get('codeLanguage') && (this.get('codeLanguage') !== 'coffeescript')) {
46 return console.error('Can\'t compile', this.get('codeLanguage'), '-- only CoffeeScript/JavaScript.', this)
47 }
48 try {
49 js = CoffeeScript.compile(code, { bare: true })
50 } catch (e) {
51 // console.log 'couldn\'t compile', code, 'for', @get('name'), 'because', e
52 js = this.get('js')
53 }
54 return js
55 }
56
57 getDependencies (allSystems) {
58 const results = []

Callers 5

setMethod · 0.95
onLoadedMethod · 0.95
compileFunction · 0.45
schemaCompileTestFunction · 0.45
schemaCompileTestFunction · 0.45

Calls 2

getMethod · 0.45
errorMethod · 0.45

Tested by 2

schemaCompileTestFunction · 0.36
schemaCompileTestFunction · 0.36