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

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

Issue 1244473002: dart2js: Fix check for support of reflection. (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
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 library dart2js.js_emitter.full_emitter; 5 library dart2js.js_emitter.full_emitter;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:collection' show HashMap; 8 import 'dart:collection' show HashMap;
9 9
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 static const String FIELD_NAMES_PROPERTY_NAME = r"$__fields__"; 281 static const String FIELD_NAMES_PROPERTY_NAME = r"$__fields__";
282 282
283 /// For deferred loading we communicate the initializers via this global var. 283 /// For deferred loading we communicate the initializers via this global var.
284 final String deferredInitializers = r"$dart_deferred_initializers$"; 284 final String deferredInitializers = r"$dart_deferred_initializers$";
285 285
286 /// Contains the global state that is needed to initialize and load a 286 /// Contains the global state that is needed to initialize and load a
287 /// deferred library. 287 /// deferred library.
288 String get globalsHolder => r"$globals$"; 288 String get globalsHolder => r"$globals$";
289 289
290 @override 290 @override
291 bool get supportsReflection => true;
292
293 @override
291 jsAst.Expression generateEmbeddedGlobalAccess(String global) { 294 jsAst.Expression generateEmbeddedGlobalAccess(String global) {
292 return js(generateEmbeddedGlobalAccessString(global)); 295 return js(generateEmbeddedGlobalAccessString(global));
293 } 296 }
294 297
295 String generateEmbeddedGlobalAccessString(String global) { 298 String generateEmbeddedGlobalAccessString(String global) {
296 // TODO(floitsch): don't use 'init' as global embedder storage. 299 // TODO(floitsch): don't use 'init' as global embedder storage.
297 return '$initName.$global'; 300 return '$initName.$global';
298 } 301 }
299 302
300 jsAst.PropertyAccess globalPropertyAccess(Element element) { 303 jsAst.PropertyAccess globalPropertyAccess(Element element) {
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2095 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2093 if (element.isInstanceMember) { 2096 if (element.isInstanceMember) {
2094 cachedClassBuilders.remove(element.enclosingClass); 2097 cachedClassBuilders.remove(element.enclosingClass);
2095 2098
2096 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2099 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2097 2100
2098 } 2101 }
2099 } 2102 }
2100 } 2103 }
2101 } 2104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698