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

Side by Side Diff: lib/runtime/dart/js.js

Issue 1718353002: Fixes #460 (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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 | tool/input_sdk/lib/js/dart2js/js_dart2js.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 dart_library.library('dart/js', null, /* Imports */[ 1 dart_library.library('dart/js', null, /* Imports */[
2 'dart/_runtime', 2 'dart/_runtime',
3 'dart/core', 3 'dart/core',
4 'dart/collection', 4 'dart/collection',
5 'dart/_js_helper' 5 'dart/_js_helper'
6 ], /* Lazy imports */[ 6 ], /* Lazy imports */[
7 ], function(exports, dart, core, collection, _js_helper) { 7 ], function(exports, dart, core, collection, _js_helper) {
8 'use strict'; 8 'use strict';
9 let dartx = dart.dartx; 9 let dartx = dart.dartx;
10 const _global = dart.global; 10 const _global = dart.global;
11 dart.defineLazyProperties(exports, { 11 dart.defineLazyProperties(exports, {
12 get context() { 12 get context() {
13 return _wrapToDart(_global); 13 return _wrapToDart(_global);
14 } 14 }
15 }); 15 });
16 const _jsObject = Symbol('_jsObject'); 16 const _jsObject = Symbol('_jsObject');
17 class JsObject extends core.Object { 17 class JsObject extends core.Object {
18 _fromJs(jsObject) { 18 _fromJs(jsObject) {
19 this[_jsObject] = jsObject; 19 this[_jsObject] = jsObject;
20 dart.assert(this[_jsObject] != null); 20 dart.assert(this[_jsObject] != null);
21 } 21 }
22 static new(constructor, arguments$) { 22 static new(constructor, arguments$) {
23 if (arguments$ === void 0) arguments$ = null; 23 if (arguments$ === void 0) arguments$ = null;
24 let ctor = constructor[_jsObject]; 24 let ctor = constructor[_jsObject];
25 if (arguments$ == null) { 25 if (arguments$ == null) {
26 return _wrapToDart(new ctor()); 26 return _wrapToDart(new ctor());
27 } 27 }
28 return _wrapToDart(new ctor(...arguments$)); 28 let unwrapped = core.List.from(arguments$[dartx.map](_convertToJS));
29 return _wrapToDart(new ctor(...unwrapped));
29 } 30 }
30 static fromBrowserObject(object) { 31 static fromBrowserObject(object) {
31 if (typeof object == 'number' || typeof object == 'string' || typeof objec t == 'boolean' || object == null) { 32 if (typeof object == 'number' || typeof object == 'string' || typeof objec t == 'boolean' || object == null) {
32 dart.throw(new core.ArgumentError("object cannot be a num, string, bool, or null")); 33 dart.throw(new core.ArgumentError("object cannot be a num, string, bool, or null"));
33 } 34 }
34 return _wrapToDart(_convertToJS(object)); 35 return _wrapToDart(_convertToJS(object));
35 } 36 }
36 static jsify(object) { 37 static jsify(object) {
37 if (!dart.is(object, core.Map) && !dart.is(object, core.Iterable)) { 38 if (!dart.is(object, core.Map) && !dart.is(object, core.Iterable)) {
38 dart.throw(new core.ArgumentError("object must be a Map or Iterable")); 39 dart.throw(new core.ArgumentError("object must be a Map or Iterable"));
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } 404 }
404 dart.fn(allowInteropCaptureThis, core.Function, [core.Function]); 405 dart.fn(allowInteropCaptureThis, core.Function, [core.Function]);
405 // Exports: 406 // Exports:
406 exports.JsObject = JsObject; 407 exports.JsObject = JsObject;
407 exports.JsFunction = JsFunction; 408 exports.JsFunction = JsFunction;
408 exports.JsArray$ = JsArray$; 409 exports.JsArray$ = JsArray$;
409 exports.JsArray = JsArray; 410 exports.JsArray = JsArray;
410 exports.allowInterop = allowInterop; 411 exports.allowInterop = allowInterop;
411 exports.allowInteropCaptureThis = allowInteropCaptureThis; 412 exports.allowInteropCaptureThis = allowInteropCaptureThis;
412 }); 413 });
OLDNEW
« no previous file with comments | « no previous file | tool/input_sdk/lib/js/dart2js/js_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698