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

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

Issue 871003002: dart2js: fix csp mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class NativeEmitter { 7 class NativeEmitter {
8 8
9 final Map<Element, ClassBuilder> cachedBuilders; 9 final Map<Element, ClassBuilder> cachedBuilders;
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 } 237 }
238 } 238 }
239 239
240 // Emit the native class interceptors that were actually used. 240 // Emit the native class interceptors that were actually used.
241 for (Class cls in classes) { 241 for (Class cls in classes) {
242 assert(!cls.onlyForRti); 242 assert(!cls.onlyForRti);
243 ClassElement classElement = cls.element; 243 ClassElement classElement = cls.element;
244 if (!cls.isNative) continue; 244 if (!cls.isNative) continue;
245 if (neededClasses.contains(cls)) { 245 if (neededClasses.contains(cls)) {
246 ClassBuilder builder = builders[classElement]; 246 ClassBuilder builder = builders[cls];
247 247
248 // In CSP mode [emitClassConstructor] and [emitClassGettersSetters] have 248 // In CSP mode [emitClassConstructor] and [emitClassGettersSetters] have
249 // a side-effect on "precompiled" functions in [OldEmitter]. For this 249 // a side-effect on "precompiled" functions in [OldEmitter]. For this
250 // reason, it is important that we don't call these methods before we 250 // reason, it is important that we don't call these methods before we
251 // are certain that a class is needed. 251 // are certain that a class is needed.
252 252
253 emitterTask.oldEmitter.classEmitter.emitConstructorsForCSP(cls); 253 emitterTask.oldEmitter.classEmitter.emitConstructorsForCSP(cls);
254 254
255 // [emitClassGettersSettersForCSP] does not affect whether or not a 255 // [emitClassGettersSettersForCSP] does not affect whether or not a
256 // class is needed. If getters/setters are emitted, the class has fields 256 // class is needed. If getters/setters are emitted, the class has fields
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 targetOutput.add(';'); 489 targetOutput.add(';');
490 } 490 }
491 targetOutput.addBuffer(jsAst.prettyPrint( 491 targetOutput.addBuffer(jsAst.prettyPrint(
492 new jsAst.ExpressionStatement(init), compiler)); 492 new jsAst.ExpressionStatement(init), compiler));
493 targetOutput.add('\n'); 493 targetOutput.add('\n');
494 } 494 }
495 495
496 targetOutput.add('\n'); 496 targetOutput.add('\n');
497 } 497 }
498 } 498 }
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