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

Side by Side Diff: tool/input_sdk/lib/js/dart2js/js_dart2js.dart

Issue 1944483002: Redo how Type objects are exposed from DDC. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: More tweaks. Created 4 years, 7 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 | « test/codegen/language/type_literal_test.dart ('k') | tool/input_sdk/patch/core_patch.dart » ('j') | 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 /** 5 /**
6 * Support for interoperating with JavaScript. 6 * Support for interoperating with JavaScript.
7 * 7 *
8 * This library provides access to JavaScript objects from Dart, allowing 8 * This library provides access to JavaScript objects from Dart, allowing
9 * Dart code to get and set properties, and call methods of JavaScript objects 9 * Dart code to get and set properties, and call methods of JavaScript objects
10 * and invoke JavaScript functions. The library takes care of converting 10 * and invoke JavaScript functions. The library takes care of converting
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 if (JS('bool', '# == null', o) || 481 if (JS('bool', '# == null', o) ||
482 JS('bool', 'typeof # == "string"', o) || 482 JS('bool', 'typeof # == "string"', o) ||
483 JS('bool', 'typeof # == "number"', o) || 483 JS('bool', 'typeof # == "number"', o) ||
484 JS('bool', 'typeof # == "boolean"', o) || 484 JS('bool', 'typeof # == "boolean"', o) ||
485 _isBrowserType(o)) { 485 _isBrowserType(o)) {
486 return o; 486 return o;
487 } else if (JS('bool', '# instanceof Date', o)) { 487 } else if (JS('bool', '# instanceof Date', o)) {
488 var ms = JS('num', '#.getTime()', o); 488 var ms = JS('num', '#.getTime()', o);
489 return new DateTime.fromMillisecondsSinceEpoch(ms); 489 return new DateTime.fromMillisecondsSinceEpoch(ms);
490 } else if (o is _DartObject && 490 } else if (o is _DartObject &&
491 JS('bool', 'dart.jsobject != dart.realRuntimeType(#)', o)) { 491 JS('bool', 'dart.jsobject != dart.getReifiedType(#)', o)) {
492 return o._dartObj; 492 return o._dartObj;
493 } else { 493 } else {
494 return _putIfAbsent(_dartProxies, o, _wrapToDart); 494 return _putIfAbsent(_dartProxies, o, _wrapToDart);
495 } 495 }
496 } 496 }
497 497
498 JsObject _wrapToDart(o) { 498 JsObject _wrapToDart(o) {
499 if (JS('bool', 'typeof # == "function"', o)) { 499 if (JS('bool', 'typeof # == "function"', o)) {
500 return new JsFunction._fromJs(o); 500 return new JsFunction._fromJs(o);
501 } 501 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 ' for (let arg of arguments) {' 551 ' for (let arg of arguments) {'
552 ' args.push(arg);' 552 ' args.push(arg);'
553 ' }' 553 ' }'
554 ' return #(...args);' 554 ' return #(...args);'
555 '}', 555 '}',
556 f); 556 f);
557 _interopCaptureThisExpando[f] = ret; 557 _interopCaptureThisExpando[f] = ret;
558 } 558 }
559 return ret; 559 return ret;
560 } 560 }
OLDNEW
« no previous file with comments | « test/codegen/language/type_literal_test.dart ('k') | tool/input_sdk/patch/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698