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

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

Issue 1207823005: dart2js: Also use new abstract names in csp mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart ('k') | 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 27498505b37e687e9e123ef91802259435bbf18b..d3b8ffbe01ab2482191425a8885c31d57afee214 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -1018,14 +1018,20 @@ class OldEmitter implements Emitter {
void assemblePrecompiledConstructor(OutputUnit outputUnit,
jsAst.Name constructorName,
jsAst.Expression constructorAst,
- List<String> fields) {
+ List<jsAst.Name> fields) {
cspPrecompiledFunctionFor(outputUnit).add(
new jsAst.FunctionDeclaration(constructorName, constructorAst));
String fieldNamesProperty = FIELD_NAMES_PROPERTY_NAME;
bool hasIsolateSupport = compiler.hasIsolateSupport;
- jsAst.Node fieldNamesArray =
- hasIsolateSupport ? js.stringArray(fields) : new jsAst.LiteralNull();
+ jsAst.Node fieldNamesArray;
+ if (hasIsolateSupport) {
+ fieldNamesArray = js.concatenateStrings(
+ js.joinLiterals(fields, js.stringPart(",")),
+ addQuotes: true);
+ } else {
+ fieldNamesArray = new jsAst.LiteralNull();
+ }
cspPrecompiledFunctionFor(outputUnit).add(js.statement(r'''
{
@@ -1084,7 +1090,7 @@ class OldEmitter implements Emitter {
// Also emit a trivial constructor for CSP mode.
jsAst.Name constructorName = mangledName;
jsAst.Expression constructorAst = js('function() {}');
- List<String> fieldNames = [];
+ List<jsAst.Name> fieldNames = [];
assemblePrecompiledConstructor(mainOutputUnit,
constructorName,
constructorAst,
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698