| 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 = [] |