Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
698 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Florent Cailhol @ooflorent
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | const RuntimeGlobals = require("../RuntimeGlobals");
|
---|
| 9 | const RuntimeModule = require("../RuntimeModule");
|
---|
| 10 | const Template = require("../Template");
|
---|
| 11 |
|
---|
| 12 | class SystemRuntimeModule extends RuntimeModule {
|
---|
| 13 | constructor() {
|
---|
| 14 | super("system");
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | /**
|
---|
| 18 | * @returns {string} runtime code
|
---|
| 19 | */
|
---|
| 20 | generate() {
|
---|
| 21 | return Template.asString([
|
---|
| 22 | `${RuntimeGlobals.system} = {`,
|
---|
| 23 | Template.indent([
|
---|
| 24 | "import: function () {",
|
---|
| 25 | Template.indent(
|
---|
| 26 | "throw new Error('System.import cannot be used indirectly');"
|
---|
| 27 | ),
|
---|
| 28 | "}"
|
---|
| 29 | ]),
|
---|
| 30 | "};"
|
---|
| 31 | ]);
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | module.exports = SystemRuntimeModule;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.