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

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

Issue 1169473003: fixes #43, remove => workaround (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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/collection.js ('k') | lib/runtime/dart/isolate.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 var convert = dart.defineLibrary(convert, {}); 1 var convert = dart.defineLibrary(convert, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var async = dart.import(async); 3 var async = dart.import(async);
4 var typed_data = dart.import(typed_data); 4 var typed_data = dart.import(typed_data);
5 var _internal = dart.import(_internal); 5 var _internal = dart.import(_internal);
6 var collection = dart.import(collection); 6 var collection = dart.import(collection);
7 (function(exports, core, async, typed_data, _internal, collection) { 7 (function(exports, core, async, typed_data, _internal, collection) {
8 'use strict'; 8 'use strict';
9 let Codec$ = dart.generic(function(S, T) { 9 let Codec$ = dart.generic(function(S, T) {
10 class Codec extends core.Object { 10 class Codec extends core.Object {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 fuse(other) { 100 fuse(other) {
101 dart.as(other, Converter$(T, core.Object)); 101 dart.as(other, Converter$(T, core.Object));
102 return new (_FusedConverter$(S, T, core.Object))(this, other); 102 return new (_FusedConverter$(S, T, core.Object))(this, other);
103 } 103 }
104 startChunkedConversion(sink) { 104 startChunkedConversion(sink) {
105 dart.as(sink, core.Sink$(T)); 105 dart.as(sink, core.Sink$(T));
106 throw new core.UnsupportedError(`This converter does not support chunked conversions: ${this}`); 106 throw new core.UnsupportedError(`This converter does not support chunked conversions: ${this}`);
107 } 107 }
108 bind(source) { 108 bind(source) {
109 dart.as(source, async.Stream$(S)); 109 dart.as(source, async.Stream$(S));
110 return async.Stream$(T).eventTransformed(source, dart.fn((sink => new _C onverterStreamEventSink(this, sink)).bind(this), _ConverterStreamEventSink, [asy nc.EventSink])); 110 return async.Stream$(T).eventTransformed(source, dart.fn(sink => new _Co nverterStreamEventSink(this, sink), _ConverterStreamEventSink, [async.EventSink] ));
111 } 111 }
112 } 112 }
113 Converter[dart.implements] = () => [async.StreamTransformer$(S, T)]; 113 Converter[dart.implements] = () => [async.StreamTransformer$(S, T)];
114 dart.setSignature(Converter, { 114 dart.setSignature(Converter, {
115 constructors: () => ({Converter: [Converter$(S, T), []]}), 115 constructors: () => ({Converter: [Converter$(S, T), []]}),
116 methods: () => ({ 116 methods: () => ({
117 fuse: [Converter$(S, core.Object), [Converter$(T, core.Object)]], 117 fuse: [Converter$(S, core.Object), [Converter$(T, core.Object)]],
118 startChunkedConversion: [ChunkedConversionSink, [core.Sink$(T)]], 118 startChunkedConversion: [ChunkedConversionSink, [core.Sink$(T)]],
119 bind: [async.Stream$(T), [async.Stream$(S)]] 119 bind: [async.Stream$(T), [async.Stream$(S)]]
120 }) 120 })
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = dart.notNull(i) + 1) { 1243 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = dart.notNull(i) + 1) {
1244 this.writeString(','); 1244 this.writeString(',');
1245 this.writeObject(list[core.$get](i)); 1245 this.writeObject(list[core.$get](i));
1246 } 1246 }
1247 } 1247 }
1248 this.writeString(']'); 1248 this.writeString(']');
1249 } 1249 }
1250 writeMap(map) { 1250 writeMap(map) {
1251 this.writeString('{'); 1251 this.writeString('{');
1252 let separator = '"'; 1252 let separator = '"';
1253 map.forEach(dart.fn(((key, value) => { 1253 map.forEach(dart.fn((key, value) => {
1254 this.writeString(separator); 1254 this.writeString(separator);
1255 separator = ',"'; 1255 separator = ',"';
1256 this.writeStringContent(key); 1256 this.writeStringContent(key);
1257 this.writeString('":'); 1257 this.writeString('":');
1258 this.writeObject(value); 1258 this.writeObject(value);
1259 }).bind(this), core.Object, [core.String, core.Object])); 1259 }, core.Object, [core.String, core.Object]));
1260 this.writeString('}'); 1260 this.writeString('}');
1261 } 1261 }
1262 } 1262 }
1263 dart.setSignature(_JsonStringifier, { 1263 dart.setSignature(_JsonStringifier, {
1264 constructors: () => ({_JsonStringifier: [_JsonStringifier, [dart.functionTyp e(core.Object, [core.Object])]]}), 1264 constructors: () => ({_JsonStringifier: [_JsonStringifier, [dart.functionTyp e(core.Object, [core.Object])]]}),
1265 methods: () => ({ 1265 methods: () => ({
1266 writeStringContent: [dart.void, [core.String]], 1266 writeStringContent: [dart.void, [core.String]],
1267 [_checkCycle]: [dart.void, [core.Object]], 1267 [_checkCycle]: [dart.void, [core.Object]],
1268 [_removeSeen]: [dart.void, [core.Object]], 1268 [_removeSeen]: [dart.void, [core.Object]],
1269 writeObject: [dart.void, [core.Object]], 1269 writeObject: [dart.void, [core.Object]],
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 this.writeString(']'); 1312 this.writeString(']');
1313 } 1313 }
1314 } 1314 }
1315 writeMap(map) { 1315 writeMap(map) {
1316 if (map.isEmpty) { 1316 if (map.isEmpty) {
1317 this.writeString('{}'); 1317 this.writeString('{}');
1318 } else { 1318 } else {
1319 this.writeString('{\n'); 1319 this.writeString('{\n');
1320 this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1; 1320 this[_indentLevel] = dart.notNull(this[_indentLevel]) + 1;
1321 let first = true; 1321 let first = true;
1322 map.forEach(dart.fn(((key, value) => { 1322 map.forEach(dart.fn((key, value) => {
1323 if (!dart.notNull(first)) { 1323 if (!dart.notNull(first)) {
1324 this.writeString(",\n"); 1324 this.writeString(",\n");
1325 } 1325 }
1326 this.writeIndentation(this[_indentLevel]); 1326 this.writeIndentation(this[_indentLevel]);
1327 this.writeString('"'); 1327 this.writeString('"');
1328 this.writeStringContent(key); 1328 this.writeStringContent(key);
1329 this.writeString('": '); 1329 this.writeString('": ');
1330 this.writeObject(value); 1330 this.writeObject(value);
1331 first = false; 1331 first = false;
1332 }).bind(this), core.Object, [core.String, core.Object])); 1332 }, core.Object, [core.String, core.Object]));
1333 this.writeString('\n'); 1333 this.writeString('\n');
1334 this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1; 1334 this[_indentLevel] = dart.notNull(this[_indentLevel]) - 1;
1335 this.writeIndentation(this[_indentLevel]); 1335 this.writeIndentation(this[_indentLevel]);
1336 this.writeString('}'); 1336 this.writeString('}');
1337 } 1337 }
1338 } 1338 }
1339 } 1339 }
1340 _JsonPrettyPrintMixin[dart.implements] = () => [_JsonStringifier]; 1340 _JsonPrettyPrintMixin[dart.implements] = () => [_JsonStringifier];
1341 dart.setSignature(_JsonPrettyPrintMixin, { 1341 dart.setSignature(_JsonPrettyPrintMixin, {
1342 methods: () => ({ 1342 methods: () => ({
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 dart.assert(dart.notNull(byte) <= 255); 1493 dart.assert(dart.notNull(byte) <= 255);
1494 if (this.index == this.buffer[core.$length]) { 1494 if (this.index == this.buffer[core.$length]) {
1495 dart.dcall(this.addChunk, this.buffer, 0, this.index); 1495 dart.dcall(this.addChunk, this.buffer, 0, this.index);
1496 this.buffer = typed_data.Uint8List.new(this.bufferSize); 1496 this.buffer = typed_data.Uint8List.new(this.bufferSize);
1497 this.index = 0; 1497 this.index = 0;
1498 } 1498 }
1499 this.buffer[core.$set]((() => { 1499 this.buffer[core.$set]((() => {
1500 let x = this.index; 1500 let x = this.index;
1501 this.index = dart.notNull(x) + 1; 1501 this.index = dart.notNull(x) + 1;
1502 return x; 1502 return x;
1503 }).bind(this)(), byte); 1503 })(), byte);
1504 } 1504 }
1505 } 1505 }
1506 dart.setSignature(_JsonUtf8Stringifier, { 1506 dart.setSignature(_JsonUtf8Stringifier, {
1507 constructors: () => ({_JsonUtf8Stringifier: [_JsonUtf8Stringifier, [core.Obj ect, core.int, core.Function]]}), 1507 constructors: () => ({_JsonUtf8Stringifier: [_JsonUtf8Stringifier, [core.Obj ect, core.int, core.Function]]}),
1508 methods: () => ({ 1508 methods: () => ({
1509 flush: [dart.void, []], 1509 flush: [dart.void, []],
1510 writeNumber: [dart.void, [core.num]], 1510 writeNumber: [dart.void, [core.num]],
1511 writeAsciiString: [dart.void, [core.String]], 1511 writeAsciiString: [dart.void, [core.String]],
1512 writeString: [dart.void, [core.String]], 1512 writeString: [dart.void, [core.String]],
1513 writeStringSlice: [dart.void, [core.String, core.int, core.int]], 1513 writeStringSlice: [dart.void, [core.String, core.int, core.int]],
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 } 2153 }
2154 [_writeSurrogate](leadingSurrogate, nextCodeUnit) { 2154 [_writeSurrogate](leadingSurrogate, nextCodeUnit) {
2155 if (_isTailSurrogate(nextCodeUnit)) { 2155 if (_isTailSurrogate(nextCodeUnit)) {
2156 let rune = _combineSurrogatePair(leadingSurrogate, nextCodeUnit); 2156 let rune = _combineSurrogatePair(leadingSurrogate, nextCodeUnit);
2157 dart.assert(dart.notNull(rune) > dart.notNull(_THREE_BYTE_LIMIT)); 2157 dart.assert(dart.notNull(rune) > dart.notNull(_THREE_BYTE_LIMIT));
2158 dart.assert(dart.notNull(rune) <= dart.notNull(_FOUR_BYTE_LIMIT)); 2158 dart.assert(dart.notNull(rune) <= dart.notNull(_FOUR_BYTE_LIMIT));
2159 this[_buffer][core.$set]((() => { 2159 this[_buffer][core.$set]((() => {
2160 let x = this[_bufferIndex]; 2160 let x = this[_bufferIndex];
2161 this[_bufferIndex] = dart.notNull(x) + 1; 2161 this[_bufferIndex] = dart.notNull(x) + 1;
2162 return x; 2162 return x;
2163 }).bind(this)(), 240 | dart.notNull(rune) >> 18); 2163 })(), 240 | dart.notNull(rune) >> 18);
2164 this[_buffer][core.$set]((() => { 2164 this[_buffer][core.$set]((() => {
2165 let x = this[_bufferIndex]; 2165 let x = this[_bufferIndex];
2166 this[_bufferIndex] = dart.notNull(x) + 1; 2166 this[_bufferIndex] = dart.notNull(x) + 1;
2167 return x; 2167 return x;
2168 }).bind(this)(), 128 | dart.notNull(rune) >> 12 & 63); 2168 })(), 128 | dart.notNull(rune) >> 12 & 63);
2169 this[_buffer][core.$set]((() => { 2169 this[_buffer][core.$set]((() => {
2170 let x = this[_bufferIndex]; 2170 let x = this[_bufferIndex];
2171 this[_bufferIndex] = dart.notNull(x) + 1; 2171 this[_bufferIndex] = dart.notNull(x) + 1;
2172 return x; 2172 return x;
2173 }).bind(this)(), 128 | dart.notNull(rune) >> 6 & 63); 2173 })(), 128 | dart.notNull(rune) >> 6 & 63);
2174 this[_buffer][core.$set]((() => { 2174 this[_buffer][core.$set]((() => {
2175 let x = this[_bufferIndex]; 2175 let x = this[_bufferIndex];
2176 this[_bufferIndex] = dart.notNull(x) + 1; 2176 this[_bufferIndex] = dart.notNull(x) + 1;
2177 return x; 2177 return x;
2178 }).bind(this)(), 128 | dart.notNull(rune) & 63); 2178 })(), 128 | dart.notNull(rune) & 63);
2179 return true; 2179 return true;
2180 } else { 2180 } else {
2181 this[_buffer][core.$set]((() => { 2181 this[_buffer][core.$set]((() => {
2182 let x = this[_bufferIndex]; 2182 let x = this[_bufferIndex];
2183 this[_bufferIndex] = dart.notNull(x) + 1; 2183 this[_bufferIndex] = dart.notNull(x) + 1;
2184 return x; 2184 return x;
2185 }).bind(this)(), 224 | dart.notNull(leadingSurrogate) >> 12); 2185 })(), 224 | dart.notNull(leadingSurrogate) >> 12);
2186 this[_buffer][core.$set]((() => { 2186 this[_buffer][core.$set]((() => {
2187 let x = this[_bufferIndex]; 2187 let x = this[_bufferIndex];
2188 this[_bufferIndex] = dart.notNull(x) + 1; 2188 this[_bufferIndex] = dart.notNull(x) + 1;
2189 return x; 2189 return x;
2190 }).bind(this)(), 128 | dart.notNull(leadingSurrogate) >> 6 & 63); 2190 })(), 128 | dart.notNull(leadingSurrogate) >> 6 & 63);
2191 this[_buffer][core.$set]((() => { 2191 this[_buffer][core.$set]((() => {
2192 let x = this[_bufferIndex]; 2192 let x = this[_bufferIndex];
2193 this[_bufferIndex] = dart.notNull(x) + 1; 2193 this[_bufferIndex] = dart.notNull(x) + 1;
2194 return x; 2194 return x;
2195 }).bind(this)(), 128 | dart.notNull(leadingSurrogate) & 63); 2195 })(), 128 | dart.notNull(leadingSurrogate) & 63);
2196 return false; 2196 return false;
2197 } 2197 }
2198 } 2198 }
2199 [_fillBuffer](str, start, end) { 2199 [_fillBuffer](str, start, end) {
2200 if (start != end && dart.notNull(_isLeadSurrogate(str.codeUnitAt(dart.notN ull(end) - 1)))) { 2200 if (start != end && dart.notNull(_isLeadSurrogate(str.codeUnitAt(dart.notN ull(end) - 1)))) {
2201 end = dart.notNull(end) - 1; 2201 end = dart.notNull(end) - 1;
2202 } 2202 }
2203 let stringIndex = null; 2203 let stringIndex = null;
2204 for (stringIndex = start; dart.notNull(stringIndex) < dart.notNull(end); s tringIndex = dart.notNull(stringIndex) + 1) { 2204 for (stringIndex = start; dart.notNull(stringIndex) < dart.notNull(end); s tringIndex = dart.notNull(stringIndex) + 1) {
2205 let codeUnit = str.codeUnitAt(stringIndex); 2205 let codeUnit = str.codeUnitAt(stringIndex);
2206 if (dart.notNull(codeUnit) <= dart.notNull(_ONE_BYTE_LIMIT)) { 2206 if (dart.notNull(codeUnit) <= dart.notNull(_ONE_BYTE_LIMIT)) {
2207 if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer][cor e.$length])) 2207 if (dart.notNull(this[_bufferIndex]) >= dart.notNull(this[_buffer][cor e.$length]))
2208 break; 2208 break;
2209 this[_buffer][core.$set]((() => { 2209 this[_buffer][core.$set]((() => {
2210 let x = this[_bufferIndex]; 2210 let x = this[_bufferIndex];
2211 this[_bufferIndex] = dart.notNull(x) + 1; 2211 this[_bufferIndex] = dart.notNull(x) + 1;
2212 return x; 2212 return x;
2213 }).bind(this)(), codeUnit); 2213 })(), codeUnit);
2214 } else if (_isLeadSurrogate(codeUnit)) { 2214 } else if (_isLeadSurrogate(codeUnit)) {
2215 if (dart.notNull(this[_bufferIndex]) + 3 >= dart.notNull(this[_buffer] [core.$length])) 2215 if (dart.notNull(this[_bufferIndex]) + 3 >= dart.notNull(this[_buffer] [core.$length]))
2216 break; 2216 break;
2217 let nextCodeUnit = str.codeUnitAt(dart.notNull(stringIndex) + 1); 2217 let nextCodeUnit = str.codeUnitAt(dart.notNull(stringIndex) + 1);
2218 let wasCombined = this[_writeSurrogate](codeUnit, nextCodeUnit); 2218 let wasCombined = this[_writeSurrogate](codeUnit, nextCodeUnit);
2219 if (wasCombined) { 2219 if (wasCombined) {
2220 stringIndex = dart.notNull(stringIndex) + 1; 2220 stringIndex = dart.notNull(stringIndex) + 1;
2221 } 2221 }
2222 } else { 2222 } else {
2223 let rune = codeUnit; 2223 let rune = codeUnit;
2224 if (dart.notNull(rune) <= dart.notNull(_TWO_BYTE_LIMIT)) { 2224 if (dart.notNull(rune) <= dart.notNull(_TWO_BYTE_LIMIT)) {
2225 if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffe r][core.$length])) 2225 if (dart.notNull(this[_bufferIndex]) + 1 >= dart.notNull(this[_buffe r][core.$length]))
2226 break; 2226 break;
2227 this[_buffer][core.$set]((() => { 2227 this[_buffer][core.$set]((() => {
2228 let x = this[_bufferIndex]; 2228 let x = this[_bufferIndex];
2229 this[_bufferIndex] = dart.notNull(x) + 1; 2229 this[_bufferIndex] = dart.notNull(x) + 1;
2230 return x; 2230 return x;
2231 }).bind(this)(), 192 | dart.notNull(rune) >> 6); 2231 })(), 192 | dart.notNull(rune) >> 6);
2232 this[_buffer][core.$set]((() => { 2232 this[_buffer][core.$set]((() => {
2233 let x = this[_bufferIndex]; 2233 let x = this[_bufferIndex];
2234 this[_bufferIndex] = dart.notNull(x) + 1; 2234 this[_bufferIndex] = dart.notNull(x) + 1;
2235 return x; 2235 return x;
2236 }).bind(this)(), 128 | dart.notNull(rune) & 63); 2236 })(), 128 | dart.notNull(rune) & 63);
2237 } else { 2237 } else {
2238 dart.assert(dart.notNull(rune) <= dart.notNull(_THREE_BYTE_LIMIT)); 2238 dart.assert(dart.notNull(rune) <= dart.notNull(_THREE_BYTE_LIMIT));
2239 if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffe r][core.$length])) 2239 if (dart.notNull(this[_bufferIndex]) + 2 >= dart.notNull(this[_buffe r][core.$length]))
2240 break; 2240 break;
2241 this[_buffer][core.$set]((() => { 2241 this[_buffer][core.$set]((() => {
2242 let x = this[_bufferIndex]; 2242 let x = this[_bufferIndex];
2243 this[_bufferIndex] = dart.notNull(x) + 1; 2243 this[_bufferIndex] = dart.notNull(x) + 1;
2244 return x; 2244 return x;
2245 }).bind(this)(), 224 | dart.notNull(rune) >> 12); 2245 })(), 224 | dart.notNull(rune) >> 12);
2246 this[_buffer][core.$set]((() => { 2246 this[_buffer][core.$set]((() => {
2247 let x = this[_bufferIndex]; 2247 let x = this[_bufferIndex];
2248 this[_bufferIndex] = dart.notNull(x) + 1; 2248 this[_bufferIndex] = dart.notNull(x) + 1;
2249 return x; 2249 return x;
2250 }).bind(this)(), 128 | dart.notNull(rune) >> 6 & 63); 2250 })(), 128 | dart.notNull(rune) >> 6 & 63);
2251 this[_buffer][core.$set]((() => { 2251 this[_buffer][core.$set]((() => {
2252 let x = this[_bufferIndex]; 2252 let x = this[_bufferIndex];
2253 this[_bufferIndex] = dart.notNull(x) + 1; 2253 this[_bufferIndex] = dart.notNull(x) + 1;
2254 return x; 2254 return x;
2255 }).bind(this)(), 128 | dart.notNull(rune) & 63); 2255 })(), 128 | dart.notNull(rune) & 63);
2256 } 2256 }
2257 } 2257 }
2258 } 2258 }
2259 return stringIndex; 2259 return stringIndex;
2260 } 2260 }
2261 } 2261 }
2262 dart.defineNamedConstructor(_Utf8Encoder, 'withBufferSize'); 2262 dart.defineNamedConstructor(_Utf8Encoder, 'withBufferSize');
2263 dart.setSignature(_Utf8Encoder, { 2263 dart.setSignature(_Utf8Encoder, {
2264 constructors: () => ({ 2264 constructors: () => ({
2265 _Utf8Encoder: [_Utf8Encoder, []], 2265 _Utf8Encoder: [_Utf8Encoder, []],
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 let to = endIndex; 2442 let to = endIndex;
2443 let mask = _ONE_BYTE_LIMIT; 2443 let mask = _ONE_BYTE_LIMIT;
2444 for (let i = from; dart.notNull(i) < dart.notNull(to); i = dart.notNull( i) + 1) { 2444 for (let i = from; dart.notNull(i) < dart.notNull(to); i = dart.notNull( i) + 1) {
2445 let unit = dart.dindex(units, i); 2445 let unit = dart.dindex(units, i);
2446 if (!dart.equals(dart.dsend(unit, '&', mask), unit)) 2446 if (!dart.equals(dart.dsend(unit, '&', mask), unit))
2447 return dart.notNull(i) - dart.notNull(from); 2447 return dart.notNull(i) - dart.notNull(from);
2448 } 2448 }
2449 return dart.notNull(to) - dart.notNull(from); 2449 return dart.notNull(to) - dart.notNull(from);
2450 }; 2450 };
2451 dart.fn(scanOneByteCharacters, core.int, [core.Object, core.int]); 2451 dart.fn(scanOneByteCharacters, core.int, [core.Object, core.int]);
2452 let addSingleBytes = ((from, to) => { 2452 let addSingleBytes = (from, to) => {
2453 dart.assert(dart.notNull(from) >= dart.notNull(startIndex) && dart.notNu ll(from) <= dart.notNull(endIndex)); 2453 dart.assert(dart.notNull(from) >= dart.notNull(startIndex) && dart.notNu ll(from) <= dart.notNull(endIndex));
2454 dart.assert(dart.notNull(to) >= dart.notNull(startIndex) && dart.notNull (to) <= dart.notNull(endIndex)); 2454 dart.assert(dart.notNull(to) >= dart.notNull(startIndex) && dart.notNull (to) <= dart.notNull(endIndex));
2455 this[_stringSink].write(core.String.fromCharCodes(codeUnits, from, to)); 2455 this[_stringSink].write(core.String.fromCharCodes(codeUnits, from, to));
2456 }).bind(this); 2456 };
2457 dart.fn(addSingleBytes, dart.void, [core.int, core.int]); 2457 dart.fn(addSingleBytes, dart.void, [core.int, core.int]);
2458 let i = startIndex; 2458 let i = startIndex;
2459 loop: 2459 loop:
2460 while (true) { 2460 while (true) {
2461 multibyte: 2461 multibyte:
2462 if (dart.notNull(expectedUnits) > 0) { 2462 if (dart.notNull(expectedUnits) > 0) {
2463 do { 2463 do {
2464 if (i == endIndex) { 2464 if (i == endIndex) {
2465 break loop; 2465 break loop;
2466 } 2466 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 return dart.notNull(this.length) > 0; 2640 return dart.notNull(this.length) > 0;
2641 } 2641 }
2642 get keys() { 2642 get keys() {
2643 if (this[_isUpgraded]) 2643 if (this[_isUpgraded])
2644 return this[_upgradedMap].keys; 2644 return this[_upgradedMap].keys;
2645 return new _JsonMapKeyIterable(this); 2645 return new _JsonMapKeyIterable(this);
2646 } 2646 }
2647 get values() { 2647 get values() {
2648 if (this[_isUpgraded]) 2648 if (this[_isUpgraded])
2649 return this[_upgradedMap].values; 2649 return this[_upgradedMap].values;
2650 return _internal.MappedIterable.new(this[_computeKeys](), dart.fn((each => this.get(each)).bind(this))); 2650 return _internal.MappedIterable.new(this[_computeKeys](), dart.fn(each => this.get(each)));
2651 } 2651 }
2652 set(key, value) { 2652 set(key, value) {
2653 if (this[_isUpgraded]) { 2653 if (this[_isUpgraded]) {
2654 this[_upgradedMap].set(key, value); 2654 this[_upgradedMap].set(key, value);
2655 } else if (this.containsKey(key)) { 2655 } else if (this.containsKey(key)) {
2656 let processed = this[_processed]; 2656 let processed = this[_processed];
2657 _JsonMap._setProperty(processed, dart.as(key, core.String), value); 2657 _JsonMap._setProperty(processed, dart.as(key, core.String), value);
2658 let original = this[_original]; 2658 let original = this[_original];
2659 if (!dart.notNull(core.identical(original, processed))) { 2659 if (!dart.notNull(core.identical(original, processed))) {
2660 _JsonMap._setProperty(original, dart.as(key, core.String), null); 2660 _JsonMap._setProperty(original, dart.as(key, core.String), null);
2661 } 2661 }
2662 } else { 2662 } else {
2663 this[_upgrade]().set(key, value); 2663 this[_upgrade]().set(key, value);
2664 } 2664 }
2665 } 2665 }
2666 addAll(other) { 2666 addAll(other) {
2667 other.forEach(dart.fn(((key, value) => { 2667 other.forEach(dart.fn((key, value) => {
2668 this.set(key, value); 2668 this.set(key, value);
2669 }).bind(this))); 2669 }));
2670 } 2670 }
2671 containsValue(value) { 2671 containsValue(value) {
2672 if (this[_isUpgraded]) 2672 if (this[_isUpgraded])
2673 return this[_upgradedMap].containsValue(value); 2673 return this[_upgradedMap].containsValue(value);
2674 let keys = this[_computeKeys](); 2674 let keys = this[_computeKeys]();
2675 for (let i = 0; dart.notNull(i) < dart.notNull(keys[core.$length]); i = da rt.notNull(i) + 1) { 2675 for (let i = 0; dart.notNull(i) < dart.notNull(keys[core.$length]); i = da rt.notNull(i) + 1) {
2676 let key = keys[core.$get](i); 2676 let key = keys[core.$get](i);
2677 if (dart.equals(this.get(key), value)) 2677 if (dart.equals(this.get(key), value))
2678 return true; 2678 return true;
2679 } 2679 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 exports.LineSplitter = LineSplitter; 2890 exports.LineSplitter = LineSplitter;
2891 exports.StringConversionSink = StringConversionSink; 2891 exports.StringConversionSink = StringConversionSink;
2892 exports.ClosableStringSink = ClosableStringSink; 2892 exports.ClosableStringSink = ClosableStringSink;
2893 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E; 2893 exports.UNICODE_REPLACEMENT_CHARACTER_RUNE = UNICODE_REPLACEMENT_CHARACTER_RUN E;
2894 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE; 2894 exports.UNICODE_BOM_CHARACTER_RUNE = UNICODE_BOM_CHARACTER_RUNE;
2895 exports.Utf8Codec = Utf8Codec; 2895 exports.Utf8Codec = Utf8Codec;
2896 exports.UTF8 = UTF8; 2896 exports.UTF8 = UTF8;
2897 exports.Utf8Encoder = Utf8Encoder; 2897 exports.Utf8Encoder = Utf8Encoder;
2898 exports.Utf8Decoder = Utf8Decoder; 2898 exports.Utf8Decoder = Utf8Decoder;
2899 })(convert, core, async, typed_data, _internal, collection); 2899 })(convert, core, async, typed_data, _internal, collection);
OLDNEW
« no previous file with comments | « lib/runtime/dart/collection.js ('k') | lib/runtime/dart/isolate.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698