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

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

Issue 1483813002: Use const for const/final top-levels, types, symbols. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebased after vsm's regen Created 5 years 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/isolate.js ('k') | lib/runtime/dart/math.js » ('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 dart.defineLazyProperties(exports, { 10 dart.defineLazyProperties(exports, {
11 get context() { 11 get context() {
12 return _wrapToDart(dart.global); 12 return _wrapToDart(dart.global);
13 } 13 }
14 }); 14 });
15 let _jsObject = Symbol('_jsObject'); 15 const _jsObject = Symbol('_jsObject');
16 class JsObject extends core.Object { 16 class JsObject extends core.Object {
17 _fromJs(jsObject) { 17 _fromJs(jsObject) {
18 this[_jsObject] = jsObject; 18 this[_jsObject] = jsObject;
19 dart.assert(this[_jsObject] != null); 19 dart.assert(this[_jsObject] != null);
20 } 20 }
21 static new(constructor, arguments$) { 21 static new(constructor, arguments$) {
22 if (arguments$ === void 0) 22 if (arguments$ === void 0)
23 arguments$ = null; 23 arguments$ = null;
24 let ctor = constructor[_jsObject]; 24 let ctor = constructor[_jsObject];
25 if (arguments$ == null) { 25 if (arguments$ == null) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 } 160 }
161 dart.defineNamedConstructor(JsFunction, '_fromJs'); 161 dart.defineNamedConstructor(JsFunction, '_fromJs');
162 dart.setSignature(JsFunction, { 162 dart.setSignature(JsFunction, {
163 constructors: () => ({ 163 constructors: () => ({
164 withThis: [JsFunction, [core.Function]], 164 withThis: [JsFunction, [core.Function]],
165 _fromJs: [JsFunction, [dart.dynamic]] 165 _fromJs: [JsFunction, [dart.dynamic]]
166 }), 166 }),
167 methods: () => ({apply: [dart.dynamic, [core.List], {thisArg: dart.dynamic}] }) 167 methods: () => ({apply: [dart.dynamic, [core.List], {thisArg: dart.dynamic}] })
168 }); 168 });
169 let _checkIndex = Symbol('_checkIndex'); 169 const _checkIndex = Symbol('_checkIndex');
170 let _checkInsertIndex = Symbol('_checkInsertIndex'); 170 const _checkInsertIndex = Symbol('_checkInsertIndex');
171 let JsArray$ = dart.generic(function(E) { 171 const JsArray$ = dart.generic(function(E) {
172 class JsArray extends dart.mixin(JsObject, collection.ListMixin$(E)) { 172 class JsArray extends dart.mixin(JsObject, collection.ListMixin$(E)) {
173 JsArray() { 173 JsArray() {
174 super._fromJs([]); 174 super._fromJs([]);
175 } 175 }
176 from(other) { 176 from(other) {
177 super._fromJs((() => { 177 super._fromJs((() => {
178 let _ = []; 178 let _ = [];
179 _[dartx.addAll](other[dartx.map](dart.as(_convertToJS, __CastType0$(E) ))); 179 _[dartx.addAll](other[dartx.map](dart.as(_convertToJS, __CastType0$(E) )));
180 return _; 180 return _;
181 })()); 181 })());
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 'length', 311 'length',
312 'length' 312 'length'
313 ]); 313 ]);
314 return JsArray; 314 return JsArray;
315 }); 315 });
316 let JsArray = JsArray$(); 316 let JsArray = JsArray$();
317 function _isBrowserType(o) { 317 function _isBrowserType(o) {
318 return o instanceof Blob || o instanceof Event || window.KeyRange && o insta nceof KeyRange || o instanceof ImageData || o instanceof Node || window.TypedDat a && o instanceof TypedData || o instanceof Window; 318 return o instanceof Blob || o instanceof Event || window.KeyRange && o insta nceof KeyRange || o instanceof ImageData || o instanceof Node || window.TypedDat a && o instanceof TypedData || o instanceof Window;
319 } 319 }
320 dart.fn(_isBrowserType, core.bool, [dart.dynamic]); 320 dart.fn(_isBrowserType, core.bool, [dart.dynamic]);
321 let _dartObj = Symbol('_dartObj'); 321 const _dartObj = Symbol('_dartObj');
322 class _DartObject extends core.Object { 322 class _DartObject extends core.Object {
323 _DartObject(dartObj) { 323 _DartObject(dartObj) {
324 this[_dartObj] = dartObj; 324 this[_dartObj] = dartObj;
325 } 325 }
326 } 326 }
327 dart.setSignature(_DartObject, { 327 dart.setSignature(_DartObject, {
328 constructors: () => ({_DartObject: [_DartObject, [dart.dynamic]]}) 328 constructors: () => ({_DartObject: [_DartObject, [dart.dynamic]]})
329 }); 329 });
330 function _convertToJS(o) { 330 function _convertToJS(o) {
331 if (o == null || typeof o == 'string' || typeof o == 'number' || typeof o == 'boolean' || dart.notNull(_isBrowserType(o))) { 331 if (o == null || typeof o == 'string' || typeof o == 'number' || typeof o == 'boolean' || dart.notNull(_isBrowserType(o))) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 for (let arg of arguments) { 408 for (let arg of arguments) {
409 args.push(arg); 409 args.push(arg);
410 } 410 }
411 return f(...args); 411 return f(...args);
412 }, core.Function); 412 }, core.Function);
413 exports._interopCaptureThisExpando.set(f, ret); 413 exports._interopCaptureThisExpando.set(f, ret);
414 } 414 }
415 return ret; 415 return ret;
416 } 416 }
417 dart.fn(allowInteropCaptureThis, core.Function, [core.Function]); 417 dart.fn(allowInteropCaptureThis, core.Function, [core.Function]);
418 let __CastType0$ = dart.generic(function(E) { 418 const __CastType0$ = dart.generic(function(E) {
419 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.d ynamic, [E])); 419 const __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart .dynamic, [E]));
420 return __CastType0; 420 return __CastType0;
421 }); 421 });
422 let __CastType0 = __CastType0$(); 422 let __CastType0 = __CastType0$();
423 // Exports: 423 // Exports:
424 exports.JsObject = JsObject; 424 exports.JsObject = JsObject;
425 exports.JsFunction = JsFunction; 425 exports.JsFunction = JsFunction;
426 exports.JsArray$ = JsArray$; 426 exports.JsArray$ = JsArray$;
427 exports.JsArray = JsArray; 427 exports.JsArray = JsArray;
428 exports.allowInterop = allowInterop; 428 exports.allowInterop = allowInterop;
429 exports.allowInteropCaptureThis = allowInteropCaptureThis; 429 exports.allowInteropCaptureThis = allowInteropCaptureThis;
430 }); 430 });
OLDNEW
« no previous file with comments | « lib/runtime/dart/isolate.js ('k') | lib/runtime/dart/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698