Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 1151813002: dart2js: Fix emitting in csp mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index 944d23c8f9fe6e1304f597774b2b15dbce17bc50..0eec3369c4bd7521af836fcbc003d1b304c08464 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -477,16 +477,18 @@ class OldEmitter implements Emitter {
// constructor-functions and getter/setter functions can be stored in the
// library-description table. Setting properties on these can be moved to
// finishClasses.
- return js.statement('''
- # = function (\$collectedClasses) {
- var \$desc;
- #;
- return #;
- };''',
- [generateEmbeddedGlobalAccess(embeddedNames.PRECOMPILED),
- cspPrecompiledFunctionFor(outputUnit),
- new jsAst.ArrayInitializer(
- cspPrecompiledConstructorNamesFor(outputUnit))]);
+ return js.statement(r"""
+ #precompiled = function ($collectedClasses$) {
+ #norename;
+ var $desc;
+ #functions;
+ return #result;
+ };""",
+ {'norename': new jsAst.Comment("// ::norenaming:: "),
+ 'precompiled': generateEmbeddedGlobalAccess(embeddedNames.PRECOMPILED),
+ 'functions': cspPrecompiledFunctionFor(outputUnit),
+ 'result': new jsAst.ArrayInitializer(
+ cspPrecompiledConstructorNamesFor(outputUnit))});
} else {
return js.comment("Constructors are generated at runtime.");
}
@@ -1044,7 +1046,7 @@ class OldEmitter implements Emitter {
#constructorName.#typeNameProperty = #constructorNameString;
if (!"name" in #constructorName)
#constructorName.name = #constructorNameString;
- $desc = $collectedClasses.#constructorName[1];
+ $desc = $collectedClasses$.#constructorName[1];
#constructorName.prototype = $desc;
''' /* next string is not a raw string */ '''
if (#hasIsolateSupport) {
@@ -1388,6 +1390,8 @@ class OldEmitter implements Emitter {
#mangledNames;
+ #cspPrecompiledFunctions;
+
#setupProgram;
#functionThatReturnsNull;
@@ -1399,8 +1403,6 @@ class OldEmitter implements Emitter {
#setupProgramName(dart, 0);
- #cspPrecompiledFunctions;
-
#getInterceptorMethods;
#oneShotInterceptors;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698