зеркало из https://github.com/mozilla/shumway.git
Коммит
31f1f67548
22
Gruntfile.js
22
Gruntfile.js
|
@ -23,7 +23,9 @@ module.exports = function(grunt) {
|
|||
|
||||
// Don't use `--removeComments` here beause it strips out closure annotations that are
|
||||
// needed by the build system.
|
||||
var commonArguments = 'node utils/typescript/tsc --target ES5 --removeComments --sourcemap -d --out build/ts/';
|
||||
var commonArguments = 'node utils/typescript/tsc --shumwayMode --target ES5 --removeComments --sourcemap -d --out build/ts/';
|
||||
|
||||
var closureCommand = 'java -jar utils/closure.jar --formatting PRETTY_PRINT --compilation_level SHUMWAY_OPTIMIZATIONS --language_in ECMASCRIPT5 ';
|
||||
|
||||
var defaultBrowserManifestFile = './resources/browser_manifests/browser_manifest.json';
|
||||
var defaultTestsManifestFile = 'test_manifest.json';
|
||||
|
@ -91,7 +93,7 @@ module.exports = function(grunt) {
|
|||
cmd: commonArguments + 'player.js src/player/references.ts'
|
||||
},
|
||||
build_shell_ts: {
|
||||
cmd: 'node utils/typescript/tsc --target ES5 --sourcemap --out build/ts/shell.js src/shell/references.ts'
|
||||
cmd: 'node utils/typescript/tsc --shumwayMode --target ES5 --sourcemap --out build/ts/shell.js src/shell/references.ts'
|
||||
},
|
||||
generate_abcs: {
|
||||
cmd: 'python generate.py',
|
||||
|
@ -136,7 +138,7 @@ module.exports = function(grunt) {
|
|||
},
|
||||
closure: {
|
||||
// This needs a special build of closure that has SHUMWAY_OPTIMIZATIONS.
|
||||
cmd: 'java -jar utils/closure.jar --formatting PRETTY_PRINT --compilation_level SHUMWAY_OPTIMIZATIONS --language_in ECMASCRIPT5 ' + [
|
||||
cmd: closureCommand + [
|
||||
"build/ts/base.js",
|
||||
"build/ts/tools.js",
|
||||
"build/ts/avm2.js",
|
||||
|
@ -147,6 +149,17 @@ module.exports = function(grunt) {
|
|||
"build/ts/player.js"
|
||||
].join(" ") + " > build/shumway.cc.js"
|
||||
},
|
||||
"closure-all": {
|
||||
// This needs a special build of closure that has SHUMWAY_OPTIMIZATIONS.
|
||||
cmd: closureCommand + ' build/ts/base.js > build/ts/base.cc.js && ' +
|
||||
closureCommand + ' build/ts/tools.js > build/ts/tools.cc.js && ' +
|
||||
closureCommand + ' build/ts/avm2.js > build/ts/avm2.cc.js && ' +
|
||||
closureCommand + ' build/ts/flash.js > build/ts/flash.cc.js && ' +
|
||||
closureCommand + ' build/ts/avm1.js > build/ts/avm1.cc.js && ' +
|
||||
closureCommand + ' build/ts/gfx-base.js > build/ts/gfx-base.cc.js && ' +
|
||||
closureCommand + ' build/ts/gfx.js > build/ts/gfx.cc.js && ' +
|
||||
closureCommand + ' build/ts/player.js > build/ts/player.cc.js'
|
||||
},
|
||||
spell: {
|
||||
// TODO: Add more files.
|
||||
cmd: 'node utils/spell/spell.js build/ts/player.js'
|
||||
|
@ -436,6 +449,9 @@ module.exports = function(grunt) {
|
|||
grunt.registerTask('closure', [
|
||||
'exec:closure'
|
||||
]);
|
||||
grunt.registerTask('closure-all', [
|
||||
'exec:closure-all'
|
||||
]);
|
||||
grunt.registerTask('travis', [
|
||||
// 'parallel:base',
|
||||
'exec:build_base_ts',
|
||||
|
|
|
@ -30259,7 +30259,7 @@ var TypeScript;
|
|||
if (equalsValueClause) {
|
||||
this.emitIndent();
|
||||
this.recordSourceMappingStart(arg);
|
||||
if (this.emitOptions.compilationSettings().shumwayMode()) {
|
||||
if (false && this.emitOptions.compilationSettings().shumwayMode()) {
|
||||
this.writeToOutput("if (arguments.length < " + (i + 1) + ") { ");
|
||||
} else {
|
||||
this.writeToOutput("if (typeof " + id.text() + " === \"undefined\") { ");
|
||||
|
@ -30558,13 +30558,40 @@ var TypeScript;
|
|||
this.emitIndent();
|
||||
}
|
||||
|
||||
this.writeToOutput("(");
|
||||
this.recordSourceMappingStart(moduleDecl);
|
||||
this.writeToOutput("function (");
|
||||
var emitClosures = !this.emitOptions.compilationSettings().shumwayMode();
|
||||
|
||||
this.moduleName = this.getModuleName(pullDecl);
|
||||
this.writeToOutputWithSourceMapRecord(this.moduleName, moduleName);
|
||||
this.writeLineToOutput(") {");
|
||||
if (emitClosures) {
|
||||
this.writeToOutput("(");
|
||||
this.recordSourceMappingStart(moduleDecl);
|
||||
this.writeToOutput("function (");
|
||||
|
||||
this.moduleName = this.getModuleName(pullDecl);
|
||||
this.writeToOutputWithSourceMapRecord(this.moduleName, moduleName);
|
||||
this.writeLineToOutput(") {");
|
||||
} else {
|
||||
if (temp === 0 /* Prog */) {
|
||||
this.writeToOutput("(function() {");
|
||||
}
|
||||
this.writeToOutput("");
|
||||
this.recordSourceMappingStart(moduleDecl);
|
||||
|
||||
this.moduleName = this.getModuleName(pullDecl);
|
||||
if (temp !== 0 /* Prog */) {
|
||||
this.writeToOutput("var ");
|
||||
}
|
||||
this.writeToOutputWithSourceMapRecord(this.moduleName, moduleName);
|
||||
|
||||
if (temp === 0 /* Prog */ && isExported) {
|
||||
this.writeLineToOutput(" = this." + moduleName.text() + " || (this." + moduleName.text() + " = {});");
|
||||
} else if (isExported || temp === 0 /* Prog */) {
|
||||
var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName;
|
||||
this.writeLineToOutput(" = " + dotMod + moduleName.text() + " || (" + dotMod + moduleName.text() + " = {});");
|
||||
} else if (!isExported && temp !== 0 /* Prog */) {
|
||||
this.writeLineToOutput(" = " + moduleName.text() + " || (" + moduleName.text() + " = {});");
|
||||
} else {
|
||||
this.writeLineToOutput(";");
|
||||
}
|
||||
}
|
||||
|
||||
this.recordSourceMappingNameStart(moduleName.text());
|
||||
|
||||
|
@ -30596,31 +30623,42 @@ var TypeScript;
|
|||
|
||||
var parentIsDynamic = temp === 2 /* DynamicModule */;
|
||||
this.recordSourceMappingStart(moduleDecl.endingToken);
|
||||
if (temp === 0 /* Prog */ && isExported) {
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")(this." + this.moduleName + " || (this." + this.moduleName + " = {}));");
|
||||
} else if (isExported || temp === 0 /* Prog */) {
|
||||
var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName;
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")(" + dotMod + this.moduleName + " || (" + dotMod + this.moduleName + " = {}));");
|
||||
} else if (!isExported && temp !== 0 /* Prog */) {
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")(" + this.moduleName + " || (" + this.moduleName + " = {}));");
|
||||
if (emitClosures) {
|
||||
if (temp === 0 /* Prog */ && isExported) {
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
if (emitClosures) {
|
||||
this.writeToOutput(")(this." + this.moduleName + " || (this." + this.moduleName + " = {}));");
|
||||
}
|
||||
} else if (isExported || temp === 0 /* Prog */) {
|
||||
var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName;
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")(" + dotMod + this.moduleName + " || (" + dotMod + this.moduleName + " = {}));");
|
||||
} else if (!isExported && temp !== 0 /* Prog */) {
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")(" + this.moduleName + " || (" + this.moduleName + " = {}));");
|
||||
} else {
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")();");
|
||||
}
|
||||
} else {
|
||||
this.writeToOutput("}");
|
||||
this.recordSourceMappingNameEnd();
|
||||
this.recordSourceMappingEnd(moduleDecl.endingToken);
|
||||
this.writeToOutput(")();");
|
||||
}
|
||||
|
||||
if (!emitClosures && temp === 0 /* Prog */) {
|
||||
this.writeToOutput("})();");
|
||||
}
|
||||
|
||||
this.recordSourceMappingEnd(moduleDecl);
|
||||
if (temp !== 0 /* Prog */ && isExported) {
|
||||
if (temp !== 0 /* Prog */ && isExported && emitClosures) {
|
||||
this.recordSourceMappingStart(moduleDecl);
|
||||
if (parentIsDynamic) {
|
||||
this.writeLineToOutput("");
|
||||
|
|
Загрузка…
Ссылка в новой задаче