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

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

Issue 1316723003: implement null aware ops, fixes #249 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 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/core.js ('k') | lib/runtime/dart_runtime.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/dart", 2 "dart_runtime/dart",
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, {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (!(typeof property == 'string') && !dart.is(property, core.num)) { 68 if (!(typeof property == 'string') && !dart.is(property, core.num)) {
69 dart.throw(new core.ArgumentError("property is not a String or num")); 69 dart.throw(new core.ArgumentError("property is not a String or num"));
70 } 70 }
71 return _convertToDart(this[_jsObject][property]); 71 return _convertToDart(this[_jsObject][property]);
72 } 72 }
73 set(property, value) { 73 set(property, value) {
74 if (!(typeof property == 'string') && !dart.is(property, core.num)) { 74 if (!(typeof property == 'string') && !dart.is(property, core.num)) {
75 dart.throw(new core.ArgumentError("property is not a String or num")); 75 dart.throw(new core.ArgumentError("property is not a String or num"));
76 } 76 }
77 this[_jsObject][property] = _convertToJS(value); 77 this[_jsObject][property] = _convertToJS(value);
78 return value;
78 } 79 }
79 get hashCode() { 80 get hashCode() {
80 return 0; 81 return 0;
81 } 82 }
82 ['=='](other) { 83 ['=='](other) {
83 return dart.is(other, JsObject) && this[_jsObject] === dart.dload(other, _ jsObject); 84 return dart.is(other, JsObject) && this[_jsObject] === dart.dload(other, _ jsObject);
84 } 85 }
85 hasProperty(property) { 86 hasProperty(property) {
86 if (!(typeof property == 'string') && !dart.is(property, core.num)) { 87 if (!(typeof property == 'string') && !dart.is(property, core.num)) {
87 dart.throw(new core.ArgumentError("property is not a String or num")); 88 dart.throw(new core.ArgumentError("property is not a String or num"));
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 this[_checkIndex](index); 206 this[_checkIndex](index);
206 } 207 }
207 return dart.as(super.get(index), E); 208 return dart.as(super.get(index), E);
208 } 209 }
209 set(index, value) { 210 set(index, value) {
210 dart.as(value, E); 211 dart.as(value, E);
211 if (dart.is(index, core.num) && index == index[dartx.toInt]()) { 212 if (dart.is(index, core.num) && index == index[dartx.toInt]()) {
212 this[_checkIndex](index); 213 this[_checkIndex](index);
213 } 214 }
214 super.set(index, value); 215 super.set(index, value);
216 return value;
215 } 217 }
216 get length() { 218 get length() {
217 let len = this[_jsObject].length; 219 let len = this[_jsObject].length;
218 if (typeof len === "number" && len >>> 0 === len) { 220 if (typeof len === "number" && len >>> 0 === len) {
219 return len; 221 return len;
220 } 222 }
221 dart.throw(new core.StateError('Bad JsArray length')); 223 dart.throw(new core.StateError('Bad JsArray length'));
222 } 224 }
223 set length(length) { 225 set length(length) {
224 super.set('length', length); 226 super.set('length', length);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.d ynamic, [E])); 394 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.d ynamic, [E]));
393 return __CastType0; 395 return __CastType0;
394 }); 396 });
395 let __CastType0 = __CastType0$(); 397 let __CastType0 = __CastType0$();
396 // Exports: 398 // Exports:
397 exports.JsObject = JsObject; 399 exports.JsObject = JsObject;
398 exports.JsFunction = JsFunction; 400 exports.JsFunction = JsFunction;
399 exports.JsArray$ = JsArray$; 401 exports.JsArray$ = JsArray$;
400 exports.JsArray = JsArray; 402 exports.JsArray = JsArray;
401 }); 403 });
OLDNEW
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/runtime/dart_runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698