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

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

Issue 1215613002: dart2js: Fix encoding of field names in csp mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 7
8 class OldEmitter implements Emitter { 8 class OldEmitter implements Emitter {
9 final Compiler compiler; 9 final Compiler compiler;
10 final CodeEmitterTask task; 10 final CodeEmitterTask task;
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 jsAst.Name constructorName, 1019 jsAst.Name constructorName,
1020 jsAst.Expression constructorAst, 1020 jsAst.Expression constructorAst,
1021 List<jsAst.Name> fields) { 1021 List<jsAst.Name> fields) {
1022 cspPrecompiledFunctionFor(outputUnit).add( 1022 cspPrecompiledFunctionFor(outputUnit).add(
1023 new jsAst.FunctionDeclaration(constructorName, constructorAst)); 1023 new jsAst.FunctionDeclaration(constructorName, constructorAst));
1024 1024
1025 String fieldNamesProperty = FIELD_NAMES_PROPERTY_NAME; 1025 String fieldNamesProperty = FIELD_NAMES_PROPERTY_NAME;
1026 bool hasIsolateSupport = compiler.hasIsolateSupport; 1026 bool hasIsolateSupport = compiler.hasIsolateSupport;
1027 jsAst.Node fieldNamesArray; 1027 jsAst.Node fieldNamesArray;
1028 if (hasIsolateSupport) { 1028 if (hasIsolateSupport) {
1029 fieldNamesArray = js.concatenateStrings( 1029 fieldNamesArray =
1030 js.joinLiterals(fields, js.stringPart(",")), 1030 new jsAst.ArrayInitializer(fields.map(js.quoteName).toList());
1031 addQuotes: true);
1032 } else { 1031 } else {
1033 fieldNamesArray = new jsAst.LiteralNull(); 1032 fieldNamesArray = new jsAst.LiteralNull();
1034 } 1033 }
1035 1034
1036 cspPrecompiledFunctionFor(outputUnit).add(js.statement(r''' 1035 cspPrecompiledFunctionFor(outputUnit).add(js.statement(r'''
1037 { 1036 {
1038 #constructorName.#typeNameProperty = #constructorNameString; 1037 #constructorName.#typeNameProperty = #constructorNameString;
1039 // IE does not have a name property. 1038 // IE does not have a name property.
1040 if (!("name" in #constructorName)) 1039 if (!("name" in #constructorName))
1041 #constructorName.name = #constructorNameString; 1040 #constructorName.name = #constructorNameString;
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2006 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2008 if (element.isInstanceMember) { 2007 if (element.isInstanceMember) {
2009 cachedClassBuilders.remove(element.enclosingClass); 2008 cachedClassBuilders.remove(element.enclosingClass);
2010 2009
2011 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2010 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2012 2011
2013 } 2012 }
2014 } 2013 }
2015 } 2014 }
2016 } 2015 }
OLDNEW
« 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