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

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

Issue 1112403004: SDK fixes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Formatting fix Created 5 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
OLDNEW
1 var _js_helper; 1 var _js_helper;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class NoSideEffects extends core.Object { 4 class NoSideEffects extends core.Object {
5 NoSideEffects() { 5 NoSideEffects() {
6 } 6 }
7 } 7 }
8 class NoThrows extends core.Object { 8 class NoThrows extends core.Object {
9 NoThrows() { 9 NoThrows() {
10 } 10 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 dart.as(key, K); 44 dart.as(key, K);
45 dart.as(val, V); 45 dart.as(val, V);
46 return this[_throwUnmodifiable](); 46 return this[_throwUnmodifiable]();
47 } 47 }
48 putIfAbsent(key, ifAbsent) { 48 putIfAbsent(key, ifAbsent) {
49 dart.as(key, K); 49 dart.as(key, K);
50 dart.as(ifAbsent, dart.functionType(V, [])); 50 dart.as(ifAbsent, dart.functionType(V, []));
51 return dart.as(this[_throwUnmodifiable](), V); 51 return dart.as(this[_throwUnmodifiable](), V);
52 } 52 }
53 remove(key) { 53 remove(key) {
54 dart.as(key, K);
55 return dart.as(this[_throwUnmodifiable](), V); 54 return dart.as(this[_throwUnmodifiable](), V);
56 } 55 }
57 clear() { 56 clear() {
58 return this[_throwUnmodifiable](); 57 return this[_throwUnmodifiable]();
59 } 58 }
60 addAll(other) { 59 addAll(other) {
61 dart.as(other, core.Map$(K, V)); 60 dart.as(other, core.Map$(K, V));
62 return this[_throwUnmodifiable](); 61 return this[_throwUnmodifiable]();
63 } 62 }
64 } 63 }
65 ConstantMap[dart.implements] = () => [core.Map$(K, V)]; 64 ConstantMap[dart.implements] = () => [core.Map$(K, V)];
66 dart.defineNamedConstructor(ConstantMap, '_'); 65 dart.defineNamedConstructor(ConstantMap, '_');
67 return ConstantMap; 66 return ConstantMap;
68 }); 67 });
69 let ConstantMap = ConstantMap$(); 68 let ConstantMap = ConstantMap$();
70 let _jsObject = Symbol('_jsObject'); 69 let _jsObject = Symbol('_jsObject');
71 let _keys = Symbol('_keys'); 70 let _keys = Symbol('_keys');
72 let _fetch = Symbol('_fetch'); 71 let _fetch = Symbol('_fetch');
73 let ConstantStringMap$ = dart.generic(function(K, V) { 72 let ConstantStringMap$ = dart.generic(function(K, V) {
74 class ConstantStringMap extends ConstantMap$(K, V) { 73 class ConstantStringMap extends ConstantMap$(K, V) {
75 _(length, jsObject, keys) { 74 _(length, jsObject, keys) {
76 this.length = length; 75 this.length = length;
77 this[_jsObject] = jsObject; 76 this[_jsObject] = jsObject;
78 this[_keys] = keys; 77 this[_keys] = keys;
79 super._(); 78 super._();
80 } 79 }
81 containsValue(needle) { 80 containsValue(needle) {
82 dart.as(needle, V);
83 return this.values[core.$any](value => dart.equals(value, needle)); 81 return this.values[core.$any](value => dart.equals(value, needle));
84 } 82 }
85 containsKey(key) { 83 containsKey(key) {
86 if (!(typeof key == 'string')) 84 if (!(typeof key == 'string'))
87 return false; 85 return false;
88 if (dart.equals('__proto__', key)) 86 if (dart.equals('__proto__', key))
89 return false; 87 return false;
90 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); 88 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String));
91 } 89 }
92 get(key) { 90 get(key) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 class GeneralConstantMap extends ConstantMap$(K, V) { 160 class GeneralConstantMap extends ConstantMap$(K, V) {
163 GeneralConstantMap(jsData) { 161 GeneralConstantMap(jsData) {
164 this[_jsData] = jsData; 162 this[_jsData] = jsData;
165 super._(); 163 super._();
166 } 164 }
167 [_getMap]() { 165 [_getMap]() {
168 if (!this.$map) { 166 if (!this.$map) {
169 let backingMap = new (collection.LinkedHashMap$(K, V))(); 167 let backingMap = new (collection.LinkedHashMap$(K, V))();
170 this.$map = fillLiteralMap(this[_jsData], backingMap); 168 this.$map = fillLiteralMap(this[_jsData], backingMap);
171 } 169 }
172 return this.$map; 170 return dart.as(this.$map, core.Map$(K, V));
173 } 171 }
174 containsValue(needle) { 172 containsValue(needle) {
175 dart.as(needle, V);
176 return this[_getMap]().containsValue(needle); 173 return this[_getMap]().containsValue(needle);
177 } 174 }
178 containsKey(key) { 175 containsKey(key) {
179 return this[_getMap]().containsKey(key); 176 return this[_getMap]().containsKey(key);
180 } 177 }
181 get(key) { 178 get(key) {
182 return this[_getMap]().get(key); 179 return this[_getMap]().get(key);
183 } 180 }
184 forEach(f) { 181 forEach(f) {
185 dart.as(f, dart.functionType(dart.void, [K, V])); 182 dart.as(f, dart.functionType(dart.void, [K, V]));
(...skipping 3887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4073 exports.jsonEncodeNative = jsonEncodeNative; 4070 exports.jsonEncodeNative = jsonEncodeNative;
4074 exports.getIsolateAffinityTag = getIsolateAffinityTag; 4071 exports.getIsolateAffinityTag = getIsolateAffinityTag;
4075 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; 4072 exports.LoadLibraryFunctionType = LoadLibraryFunctionType;
4076 exports.DeferredLoadCallback = DeferredLoadCallback; 4073 exports.DeferredLoadCallback = DeferredLoadCallback;
4077 exports.loadDeferredLibrary = loadDeferredLibrary; 4074 exports.loadDeferredLibrary = loadDeferredLibrary;
4078 exports.MainError = MainError; 4075 exports.MainError = MainError;
4079 exports.missingMain = missingMain; 4076 exports.missingMain = missingMain;
4080 exports.badMain = badMain; 4077 exports.badMain = badMain;
4081 exports.mainHasTooManyParameters = mainHasTooManyParameters; 4078 exports.mainHasTooManyParameters = mainHasTooManyParameters;
4082 })(_js_helper || (_js_helper = {})); 4079 })(_js_helper || (_js_helper = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698