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

Side by Side Diff: lib/src/codegen/js_codegen.dart

Issue 1094243007: Fix Array constructor bug impacting dart2js and ddc running on the same page. (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: ptal Created 5 years, 8 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 | « lib/runtime/dart_runtime.js ('k') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.js_codegen; 5 library dev_compiler.src.codegen.js_codegen;
6 6
7 import 'dart:collection' show HashSet, HashMap; 7 import 'dart:collection' show HashSet, HashMap;
8 8
9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; 10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // the native JS type eagerly at this point. 350 // the native JS type eagerly at this point.
351 // If we wanted to support laziness, we could defer the hookup until 351 // If we wanted to support laziness, we could defer the hookup until
352 // the end of the Dart library cycle load. 352 // the end of the Dart library cycle load.
353 assert(!_lazyClass(type)); 353 assert(!_lazyClass(type));
354 354
355 // TODO(jmesserly): this copies the dynamic members. 355 // TODO(jmesserly): this copies the dynamic members.
356 // Probably fine for objects coming from JS, but not if we actually 356 // Probably fine for objects coming from JS, but not if we actually
357 // want to support construction of instances with generic types other 357 // want to support construction of instances with generic types other
358 // than dynamic. See issue #154 for Array and List<E> related bug. 358 // than dynamic. See issue #154 for Array and List<E> related bug.
359 var copyMembers = js.statement( 359 var copyMembers = js.statement(
360 'dart.copyProperties(dart.global.#.prototype, #.prototype);', [ 360 'dart.registerExtension(dart.global.#, #);', [
361 _propertyName(jsPeerName), 361 _propertyName(jsPeerName),
362 classElem.name 362 classElem.name
363 ]); 363 ]);
364 return _statement([result, copyMembers]); 364 return _statement([result, copyMembers]);
365 } 365 }
366 } 366 }
367 return result; 367 return result;
368 } 368 }
369 369
370 @override 370 @override
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 // TODO(jmesserly): validate the library. See issue #135. 2469 // TODO(jmesserly): validate the library. See issue #135.
2470 bool _isJsNameAnnotation(DartObjectImpl value) => value.type.name == 'JsName'; 2470 bool _isJsNameAnnotation(DartObjectImpl value) => value.type.name == 'JsName';
2471 2471
2472 bool _isJsPeerInterface(DartObjectImpl value) => 2472 bool _isJsPeerInterface(DartObjectImpl value) =>
2473 value.type.name == 'JsPeerInterface'; 2473 value.type.name == 'JsPeerInterface';
2474 2474
2475 // TODO(jacobr): we would like to do something like the following 2475 // TODO(jacobr): we would like to do something like the following
2476 // but we don't have summary support yet. 2476 // but we don't have summary support yet.
2477 // bool _supportJsExtensionMethod(AnnotatedNode node) => 2477 // bool _supportJsExtensionMethod(AnnotatedNode node) =>
2478 // _getAnnotation(node, "SupportJsExtensionMethod") != null; 2478 // _getAnnotation(node, "SupportJsExtensionMethod") != null;
OLDNEW
« no previous file with comments | « lib/runtime/dart_runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698