| 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 ad8fa35a7bbcbbf690141ca3007118df8013784f..40c4cbccc81839d0d01c578693a4ea9148f3cf4e 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
|
| @@ -490,9 +490,11 @@ class OldEmitter implements Emitter {
|
|
|
| var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
| - if (typeof dart_precompiled == "function") {
|
| + if (#inCspMode) {
|
| constructors = dart_precompiled(collectedClasses);
|
| - } else {
|
| + }
|
| +
|
| + if (#notInCspMode) {
|
| var combinedConstructorFunction =
|
| "function \$reflectable(fn){fn.$reflectableField=1;return fn};\\n"+
|
| "var \$desc;\\n";
|
| @@ -529,17 +531,17 @@ class OldEmitter implements Emitter {
|
| })(functionSignature);
|
| }
|
|
|
| - if (typeof dart_precompiled != "function") {
|
| + if (#notInCspMode) {
|
| combinedConstructorFunction += defineClass(cls, fields);
|
| constructorsList.push(cls);
|
| }
|
| if (supr) pendingClasses[cls] = supr;
|
| }
|
|
|
| - if (typeof dart_precompiled != "function") {
|
| + if (#notInCspMode) {
|
| combinedConstructorFunction +=
|
| - "return [\\n " + constructorsList.join(",\\n ") + "\\n]";
|
| - var constructors =
|
| + "return [\\n " + constructorsList.join(",\\n ") + "\\n]";
|
| + var constructors =
|
| new Function("\$collectedClasses", combinedConstructorFunction)
|
| (collectedClasses);
|
| combinedConstructorFunction = null;
|
| @@ -573,7 +575,9 @@ class OldEmitter implements Emitter {
|
| 'metadata': metadataAccess,
|
| 'isTreeShakingDisabled': backend.isTreeShakingDisabled,
|
| 'finishClassFunction': buildFinishClass(),
|
| - 'trivialNsmHandlers': nsmEmitter.buildTrivialNsmHandlers()});
|
| + 'trivialNsmHandlers': nsmEmitter.buildTrivialNsmHandlers(),
|
| + 'inCspMode': compiler.useContentSecurityPolicy,
|
| + 'notInCspMode': !compiler.useContentSecurityPolicy});
|
| }
|
|
|
| jsAst.Node optional(bool condition, jsAst.Node node) {
|
|
|