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

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

Issue 1096583002: Reifier hookup (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Address comments Created 5 years, 8 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/convert.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 core; 1 var core;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class Object { 4 class Object {
5 constructor() { 5 constructor() {
6 let name = this.constructor.name; 6 let name = this.constructor.name;
7 let init = this[name]; 7 let init = this[name];
8 let result = void 0; 8 let result = void 0;
9 if (init) 9 if (init)
10 result = init.apply(this, arguments); 10 result = init.apply(this, arguments);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 dart.defineNamedConstructor(bool, 'fromEnvironment'); 73 dart.defineNamedConstructor(bool, 'fromEnvironment');
74 let _toMangledNames = dart.JsSymbol('_toMangledNames'); 74 let _toMangledNames = dart.JsSymbol('_toMangledNames');
75 class Function extends Object { 75 class Function extends Object {
76 static apply(f, positionalArguments, namedArguments) { 76 static apply(f, positionalArguments, namedArguments) {
77 if (namedArguments === void 0) 77 if (namedArguments === void 0)
78 namedArguments = null; 78 namedArguments = null;
79 return _js_helper.Primitives.applyFunction(f, positionalArguments, namedAr guments == null ? null : Function[_toMangledNames](namedArguments)); 79 return _js_helper.Primitives.applyFunction(f, positionalArguments, namedAr guments == null ? null : Function[_toMangledNames](namedArguments));
80 } 80 }
81 static [_toMangledNames](namedArguments) { 81 static [_toMangledNames](namedArguments) {
82 let result = dart.as(dart.map(), Map$(String, dart.dynamic)); 82 let result = dart.map();
83 namedArguments.forEach(dart.as((symbol, value) => { 83 namedArguments.forEach((symbol, value) => {
84 result.set(_symbolToString(dart.as(symbol, Symbol)), value); 84 result.set(_symbolToString(dart.as(symbol, Symbol)), value);
85 }, dart.functionType(dart.void, [Symbol, dart.dynamic]))); 85 });
86 return result; 86 return result;
87 } 87 }
88 } 88 }
89 let Comparator$ = dart.generic(function(T) { 89 let Comparator$ = dart.generic(function(T) {
90 let Comparator = dart.typedef('Comparator', () => dart.functionType(int, [T, T])); 90 let Comparator = dart.typedef('Comparator', () => dart.functionType(int, [T, T]));
91 return Comparator; 91 return Comparator;
92 }); 92 });
93 let Comparator = Comparator$(); 93 let Comparator = Comparator$();
94 let Comparable$ = dart.generic(function(T) { 94 let Comparable$ = dart.generic(function(T) {
95 class Comparable extends Object { 95 class Comparable extends Object {
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 static get base() { 2062 static get base() {
2063 let uri = _js_helper.Primitives.currentUri(); 2063 let uri = _js_helper.Primitives.currentUri();
2064 if (uri != null) 2064 if (uri != null)
2065 return Uri.parse(uri); 2065 return Uri.parse(uri);
2066 throw new UnsupportedError("'Uri.base' is not supported"); 2066 throw new UnsupportedError("'Uri.base' is not supported");
2067 } 2067 }
2068 static get [_isWindows]() { 2068 static get [_isWindows]() {
2069 return false; 2069 return false;
2070 } 2070 }
2071 static [_checkNonWindowsPathReservedCharacters](segments, argumentError) { 2071 static [_checkNonWindowsPathReservedCharacters](segments, argumentError) {
2072 segments[exports.$forEach](dart.as(segment => { 2072 segments[exports.$forEach](segment => {
2073 if (dart.dsend(segment, 'contains', "/")) { 2073 if (dart.dsend(segment, 'contains', "/")) {
2074 if (argumentError) { 2074 if (argumentError) {
2075 throw new ArgumentError(`Illegal path character ${segment}`); 2075 throw new ArgumentError(`Illegal path character ${segment}`);
2076 } else { 2076 } else {
2077 throw new UnsupportedError(`Illegal path character ${segment}`); 2077 throw new UnsupportedError(`Illegal path character ${segment}`);
2078 } 2078 }
2079 } 2079 }
2080 }, dart.functionType(dart.void, [String]))); 2080 });
2081 } 2081 }
2082 static [_checkWindowsPathReservedCharacters](segments, argumentError, firstS egment) { 2082 static [_checkWindowsPathReservedCharacters](segments, argumentError, firstS egment) {
2083 if (firstSegment === void 0) 2083 if (firstSegment === void 0)
2084 firstSegment = 0; 2084 firstSegment = 0;
2085 segments[exports.$skip](firstSegment)[exports.$forEach](dart.as(segment => { 2085 segments[exports.$skip](firstSegment)[exports.$forEach](segment => {
2086 if (dart.dsend(segment, 'contains', new RegExp('["*/:<>?\\\\|]'))) { 2086 if (dart.dsend(segment, 'contains', new RegExp('["*/:<>?\\\\|]'))) {
2087 if (argumentError) { 2087 if (argumentError) {
2088 throw new ArgumentError("Illegal character in path"); 2088 throw new ArgumentError("Illegal character in path");
2089 } else { 2089 } else {
2090 throw new UnsupportedError("Illegal character in path"); 2090 throw new UnsupportedError("Illegal character in path");
2091 } 2091 }
2092 } 2092 }
2093 }, dart.functionType(dart.void, [String]))); 2093 });
2094 } 2094 }
2095 static [_checkWindowsDriveLetter](charCode, argumentError) { 2095 static [_checkWindowsDriveLetter](charCode, argumentError) {
2096 if (dart.notNull(Uri[_UPPER_CASE_A]) <= dart.notNull(charCode) && dart.not Null(charCode) <= dart.notNull(Uri[_UPPER_CASE_Z]) || dart.notNull(Uri[_LOWER_CA SE_A]) <= dart.notNull(charCode) && dart.notNull(charCode) <= dart.notNull(Uri[_ LOWER_CASE_Z])) { 2096 if (dart.notNull(Uri[_UPPER_CASE_A]) <= dart.notNull(charCode) && dart.not Null(charCode) <= dart.notNull(Uri[_UPPER_CASE_Z]) || dart.notNull(Uri[_LOWER_CA SE_A]) <= dart.notNull(charCode) && dart.notNull(charCode) <= dart.notNull(Uri[_ LOWER_CASE_Z])) {
2097 return; 2097 return;
2098 } 2098 }
2099 if (argumentError) { 2099 if (argumentError) {
2100 throw new ArgumentError("Illegal drive letter " + dart.notNull(new Strin g.fromCharCode(charCode))); 2100 throw new ArgumentError("Illegal drive letter " + dart.notNull(new Strin g.fromCharCode(charCode)));
2101 } else { 2101 } else {
2102 throw new UnsupportedError("Illegal drive letter " + dart.notNull(new St ring.fromCharCode(charCode))); 2102 throw new UnsupportedError("Illegal drive letter " + dart.notNull(new St ring.fromCharCode(charCode)));
2103 } 2103 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 } 2213 }
2214 get pathSegments() { 2214 get pathSegments() {
2215 if (this[_pathSegments] == null) { 2215 if (this[_pathSegments] == null) {
2216 let pathToSplit = !dart.notNull(this.path.isEmpty) && this.path.codeUnit At(0) == Uri[_SLASH] ? this.path.substring(1) : this.path; 2216 let pathToSplit = !dart.notNull(this.path.isEmpty) && this.path.codeUnit At(0) == Uri[_SLASH] ? this.path.substring(1) : this.path;
2217 this[_pathSegments] = new collection.UnmodifiableListView(pathToSplit == "" ? /* Unimplemented const */new List$(String).from([]) : pathToSplit.split("/ ")[exports.$map](Uri.decodeComponent)[exports.$toList]({growable: false})); 2217 this[_pathSegments] = new collection.UnmodifiableListView(pathToSplit == "" ? /* Unimplemented const */new List$(String).from([]) : pathToSplit.split("/ ")[exports.$map](Uri.decodeComponent)[exports.$toList]({growable: false}));
2218 } 2218 }
2219 return this[_pathSegments]; 2219 return this[_pathSegments];
2220 } 2220 }
2221 get queryParameters() { 2221 get queryParameters() {
2222 if (this[_queryParameters] == null) { 2222 if (this[_queryParameters] == null) {
2223 this[_queryParameters] = dart.as(new collection.UnmodifiableMapView(Uri. splitQueryString(this.query)), Map$(String, String)); 2223 this[_queryParameters] = new (collection.UnmodifiableMapView$(String, St ring))(Uri.splitQueryString(this.query));
2224 } 2224 }
2225 return this[_queryParameters]; 2225 return this[_queryParameters];
2226 } 2226 }
2227 static [_makePort](port, scheme) { 2227 static [_makePort](port, scheme) {
2228 if (port != null && port == Uri[_defaultPort](scheme)) 2228 if (port != null && port == Uri[_defaultPort](scheme))
2229 return null; 2229 return null;
2230 return port; 2230 return port;
2231 } 2231 }
2232 static [_makeHost](host, start, end, strictIPv6) { 2232 static [_makeHost](host, start, end, strictIPv6) {
2233 if (host == null) 2233 if (host == null)
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 static [_makePath](path, start, end, pathSegments, ensureLeadingSlash, isFil e) { 2357 static [_makePath](path, start, end, pathSegments, ensureLeadingSlash, isFil e) {
2358 if (path == null && dart.notNull(pathSegments == null)) 2358 if (path == null && dart.notNull(pathSegments == null))
2359 return isFile ? "/" : ""; 2359 return isFile ? "/" : "";
2360 if (path != null && dart.notNull(pathSegments != null)) { 2360 if (path != null && dart.notNull(pathSegments != null)) {
2361 throw new ArgumentError('Both path and pathSegments specified'); 2361 throw new ArgumentError('Both path and pathSegments specified');
2362 } 2362 }
2363 let result = null; 2363 let result = null;
2364 if (path != null) { 2364 if (path != null) {
2365 result = Uri[_normalize](path, start, end, dart.as(Uri[_pathCharOrSlashT able], List$(int))); 2365 result = Uri[_normalize](path, start, end, dart.as(Uri[_pathCharOrSlashT able], List$(int)));
2366 } else { 2366 } else {
2367 result = pathSegments[exports.$map](dart.as(s => Uri[_uriEncode](dart.as (Uri[_pathCharTable], List$(int)), dart.as(s, String)), dart.functionType(dart.d ynamic, [String])))[exports.$join]("/"); 2367 result = pathSegments[exports.$map](s => Uri[_uriEncode](dart.as(Uri[_pa thCharTable], List$(int)), dart.as(s, String)))[exports.$join]("/");
2368 } 2368 }
2369 if (dart.dload(result, 'isEmpty')) { 2369 if (dart.dload(result, 'isEmpty')) {
2370 if (isFile) 2370 if (isFile)
2371 return "/"; 2371 return "/";
2372 } else if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash)) && d art.notNull(!dart.equals(dart.dsend(result, 'codeUnitAt', 0), Uri[_SLASH]))) { 2372 } else if ((dart.notNull(isFile) || dart.notNull(ensureLeadingSlash)) && d art.notNull(!dart.equals(dart.dsend(result, 'codeUnitAt', 0), Uri[_SLASH]))) {
2373 return `/${result}`; 2373 return `/${result}`;
2374 } 2374 }
2375 return dart.as(result, String); 2375 return dart.as(result, String);
2376 } 2376 }
2377 static [_makeQuery](query, start, end, queryParameters) { 2377 static [_makeQuery](query, start, end, queryParameters) {
2378 if (query == null && dart.notNull(queryParameters == null)) 2378 if (query == null && dart.notNull(queryParameters == null))
2379 return null; 2379 return null;
2380 if (query != null && dart.notNull(queryParameters != null)) { 2380 if (query != null && dart.notNull(queryParameters != null)) {
2381 throw new ArgumentError('Both query and queryParameters specified'); 2381 throw new ArgumentError('Both query and queryParameters specified');
2382 } 2382 }
2383 if (query != null) 2383 if (query != null)
2384 return Uri[_normalize](query, start, end, dart.as(Uri[_queryCharTable], List$(int))); 2384 return Uri[_normalize](query, start, end, dart.as(Uri[_queryCharTable], List$(int)));
2385 let result = new StringBuffer(); 2385 let result = new StringBuffer();
2386 let first = true; 2386 let first = true;
2387 queryParameters.forEach(dart.as((key, value) => { 2387 queryParameters.forEach((key, value) => {
2388 if (!dart.notNull(first)) { 2388 if (!dart.notNull(first)) {
2389 result.write("&"); 2389 result.write("&");
2390 } 2390 }
2391 first = false; 2391 first = false;
2392 result.write(Uri.encodeQueryComponent(dart.as(key, String))); 2392 result.write(Uri.encodeQueryComponent(dart.as(key, String)));
2393 if (dart.notNull(value != null) && dart.notNull(dart.dsend(dart.dload(va lue, 'isEmpty'), '!'))) { 2393 if (dart.notNull(value != null) && dart.notNull(dart.dsend(dart.dload(va lue, 'isEmpty'), '!'))) {
2394 result.write("="); 2394 result.write("=");
2395 result.write(Uri.encodeQueryComponent(dart.as(value, String))); 2395 result.write(Uri.encodeQueryComponent(dart.as(value, String)));
2396 } 2396 }
2397 }, dart.functionType(dart.void, [String, String]))); 2397 });
2398 return result.toString(); 2398 return result.toString();
2399 } 2399 }
2400 static [_makeFragment](fragment, start, end) { 2400 static [_makeFragment](fragment, start, end) {
2401 if (fragment == null) 2401 if (fragment == null)
2402 return null; 2402 return null;
2403 return Uri[_normalize](fragment, start, end, dart.as(Uri[_queryCharTable], List$(int))); 2403 return Uri[_normalize](fragment, start, end, dart.as(Uri[_queryCharTable], List$(int)));
2404 } 2404 }
2405 static [_stringOrNullLength](s) { 2405 static [_stringOrNullLength](s) {
2406 return s == null ? 0 : s.length; 2406 return s == null ? 0 : s.length;
2407 } 2407 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 } 2565 }
2566 [_hasDotSegments](path) { 2566 [_hasDotSegments](path) {
2567 if (dart.notNull(path.length) > 0 && path.codeUnitAt(0) == Uri[_DOT]) 2567 if (dart.notNull(path.length) > 0 && path.codeUnitAt(0) == Uri[_DOT])
2568 return true; 2568 return true;
2569 let index = path.indexOf("/."); 2569 let index = path.indexOf("/.");
2570 return index != -1; 2570 return index != -1;
2571 } 2571 }
2572 [_removeDotSegments](path) { 2572 [_removeDotSegments](path) {
2573 if (!dart.notNull(this[_hasDotSegments](path))) 2573 if (!dart.notNull(this[_hasDotSegments](path)))
2574 return path; 2574 return path;
2575 let output = dart.as(new List.from([]), List$(String)); 2575 let output = new List$(String).from([]);
2576 let appendSlash = false; 2576 let appendSlash = false;
2577 for (let segment of path.split("/")) { 2577 for (let segment of path.split("/")) {
2578 appendSlash = false; 2578 appendSlash = false;
2579 if (segment == "..") { 2579 if (segment == "..") {
2580 if (!dart.notNull(output[exports.$isEmpty]) && (output[exports.$length ] != 1 || output[exports.$get](0) != "")) 2580 if (!dart.notNull(output[exports.$isEmpty]) && (output[exports.$length ] != 1 || output[exports.$get](0) != ""))
2581 output[exports.$removeLast](); 2581 output[exports.$removeLast]();
2582 appendSlash = true; 2582 appendSlash = true;
2583 } else if ("." == segment) { 2583 } else if ("." == segment) {
2584 appendSlash = true; 2584 appendSlash = true;
2585 } else { 2585 } else {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2786 return Uri[_uriDecode](encodedComponent, {plusToSpace: true, encoding: enc oding}); 2786 return Uri[_uriDecode](encodedComponent, {plusToSpace: true, encoding: enc oding});
2787 } 2787 }
2788 static encodeFull(uri) { 2788 static encodeFull(uri) {
2789 return Uri[_uriEncode](dart.as(Uri[_encodeFullTable], List$(int)), uri); 2789 return Uri[_uriEncode](dart.as(Uri[_encodeFullTable], List$(int)), uri);
2790 } 2790 }
2791 static decodeFull(uri) { 2791 static decodeFull(uri) {
2792 return Uri[_uriDecode](uri); 2792 return Uri[_uriDecode](uri);
2793 } 2793 }
2794 static splitQueryString(query, opts) { 2794 static splitQueryString(query, opts) {
2795 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8; 2795 let encoding = opts && 'encoding' in opts ? opts.encoding : convert.UTF8;
2796 return dart.as(query.split("&")[exports.$fold](dart.map(), dart.as((map, e lement) => { 2796 return dart.as(query.split("&")[exports.$fold](dart.map(), (map, element) => {
2797 let index = dart.as(dart.dsend(element, 'indexOf', "="), int); 2797 let index = dart.as(dart.dsend(element, 'indexOf', "="), int);
2798 if (index == -1) { 2798 if (index == -1) {
2799 if (!dart.equals(element, "")) { 2799 if (!dart.equals(element, "")) {
2800 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(element, String ), {encoding: encoding}), ""); 2800 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(element, String ), {encoding: encoding}), "");
2801 } 2801 }
2802 } else if (index != 0) { 2802 } else if (index != 0) {
2803 let key = dart.dsend(element, 'substring', 0, index); 2803 let key = dart.dsend(element, 'substring', 0, index);
2804 let value = dart.dsend(element, 'substring', dart.notNull(index) + 1); 2804 let value = dart.dsend(element, 'substring', dart.notNull(index) + 1);
2805 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en coding: encoding}), Uri.decodeQueryComponent(dart.as(value, String), {encoding: encoding})); 2805 dart.dsetindex(map, Uri.decodeQueryComponent(dart.as(key, String), {en coding: encoding}), Uri.decodeQueryComponent(dart.as(value, String), {encoding: encoding}));
2806 } 2806 }
2807 return map; 2807 return map;
2808 }, dart.functionType(dart.dynamic, [dart.dynamic, String]))), Map$(String, String)); 2808 }), Map$(String, String));
2809 } 2809 }
2810 static parseIPv4Address(host) { 2810 static parseIPv4Address(host) {
2811 // Function error: (String) → void 2811 // Function error: (String) → void
2812 function error(msg) { 2812 function error(msg) {
2813 throw new FormatException(`Illegal IPv4 address, ${msg}`); 2813 throw new FormatException(`Illegal IPv4 address, ${msg}`);
2814 } 2814 }
2815 let bytes = host.split('.'); 2815 let bytes = host.split('.');
2816 if (bytes[exports.$length] != 4) { 2816 if (bytes[exports.$length] != 4) {
2817 error('IPv4 address should contain exactly 4 parts'); 2817 error('IPv4 address should contain exactly 4 parts');
2818 } 2818 }
2819 return dart.as(bytes[exports.$map](dart.as(byteString => { 2819 return dart.as(bytes[exports.$map](byteString => {
2820 let byte = int.parse(dart.as(byteString, String)); 2820 let byte = int.parse(dart.as(byteString, String));
2821 if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) { 2821 if (dart.notNull(byte) < 0 || dart.notNull(byte) > 255) {
2822 error('each part must be in the range of `0..255`'); 2822 error('each part must be in the range of `0..255`');
2823 } 2823 }
2824 return byte; 2824 return byte;
2825 }, dart.functionType(dart.dynamic, [String])))[exports.$toList](), List$(i nt)); 2825 })[exports.$toList](), List$(int));
2826 } 2826 }
2827 static parseIPv6Address(host, start, end) { 2827 static parseIPv6Address(host, start, end) {
2828 if (start === void 0) 2828 if (start === void 0)
2829 start = 0; 2829 start = 0;
2830 if (end === void 0) 2830 if (end === void 0)
2831 end = null; 2831 end = null;
2832 if (end == null) 2832 if (end == null)
2833 end = host.length; 2833 end = host.length;
2834 // Function error: (String, [dynamic]) → void 2834 // Function error: (String, [dynamic]) → void
2835 function error(msg, position) { 2835 function error(msg, position) {
2836 if (position === void 0) 2836 if (position === void 0)
2837 position = null; 2837 position = null;
2838 throw new FormatException(`Illegal IPv6 address, ${msg}`, host, dart.as( position, int)); 2838 throw new FormatException(`Illegal IPv6 address, ${msg}`, host, dart.as( position, int));
2839 } 2839 }
2840 // Function parseHex: (int, int) → int 2840 // Function parseHex: (int, int) → int
2841 function parseHex(start, end) { 2841 function parseHex(start, end) {
2842 if (dart.notNull(end) - dart.notNull(start) > 4) { 2842 if (dart.notNull(end) - dart.notNull(start) > 4) {
2843 error('an IPv6 part can only contain a maximum of 4 hex digits', start ); 2843 error('an IPv6 part can only contain a maximum of 4 hex digits', start );
2844 } 2844 }
2845 let value = int.parse(host.substring(start, end), {radix: 16}); 2845 let value = int.parse(host.substring(start, end), {radix: 16});
2846 if (dart.notNull(value) < 0 || dart.notNull(value) > (1 << 16) - 1) { 2846 if (dart.notNull(value) < 0 || dart.notNull(value) > (1 << 16) - 1) {
2847 error('each part must be in the range of `0x0..0xFFFF`', start); 2847 error('each part must be in the range of `0x0..0xFFFF`', start);
2848 } 2848 }
2849 return value; 2849 return value;
2850 } 2850 }
2851 if (dart.notNull(host.length) < 2) 2851 if (dart.notNull(host.length) < 2)
2852 error('address is too short'); 2852 error('address is too short');
2853 let parts = dart.as(new List.from([]), List$(int)); 2853 let parts = new List$(int).from([]);
2854 let wildcardSeen = false; 2854 let wildcardSeen = false;
2855 let partStart = start; 2855 let partStart = start;
2856 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) { 2856 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull( i) + 1) {
2857 if (host.codeUnitAt(i) == Uri[_COLON]) { 2857 if (host.codeUnitAt(i) == Uri[_COLON]) {
2858 if (i == start) { 2858 if (i == start) {
2859 i = dart.notNull(i) + 1; 2859 i = dart.notNull(i) + 1;
2860 if (host.codeUnitAt(i) != Uri[_COLON]) { 2860 if (host.codeUnitAt(i) != Uri[_COLON]) {
2861 error('invalid start colon.', i); 2861 error('invalid start colon.', i);
2862 } 2862 }
2863 partStart = i; 2863 partStart = i;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 simple = codeUnit != Uri[_PERCENT] && codeUnit != Uri[_PLUS]; 2971 simple = codeUnit != Uri[_PERCENT] && codeUnit != Uri[_PLUS];
2972 } 2972 }
2973 let bytes = null; 2973 let bytes = null;
2974 if (simple) { 2974 if (simple) {
2975 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) { 2975 if (dart.notNull(dart.equals(encoding, convert.UTF8)) || dart.notNull(da rt.equals(encoding, convert.LATIN1))) {
2976 return text; 2976 return text;
2977 } else { 2977 } else {
2978 bytes = text.codeUnits; 2978 bytes = text.codeUnits;
2979 } 2979 }
2980 } else { 2980 } else {
2981 bytes = dart.as(new List(), List$(int)); 2981 bytes = new (List$(int))();
2982 for (let i = 0; dart.notNull(i) < dart.notNull(text.length); i = dart.no tNull(i) + 1) { 2982 for (let i = 0; dart.notNull(i) < dart.notNull(text.length); i = dart.no tNull(i) + 1) {
2983 let codeUnit = text.codeUnitAt(i); 2983 let codeUnit = text.codeUnitAt(i);
2984 if (dart.notNull(codeUnit) > 127) { 2984 if (dart.notNull(codeUnit) > 127) {
2985 throw new ArgumentError("Illegal percent encoding in URI"); 2985 throw new ArgumentError("Illegal percent encoding in URI");
2986 } 2986 }
2987 if (codeUnit == Uri[_PERCENT]) { 2987 if (codeUnit == Uri[_PERCENT]) {
2988 if (dart.notNull(i) + 3 > dart.notNull(text.length)) { 2988 if (dart.notNull(i) + 3 > dart.notNull(text.length)) {
2989 throw new ArgumentError('Truncated URI'); 2989 throw new ArgumentError('Truncated URI');
2990 } 2990 }
2991 bytes[exports.$add](Uri[_hexCharPairToByte](text, dart.notNull(i) + 1)); 2991 bytes[exports.$add](Uri[_hexCharPairToByte](text, dart.notNull(i) + 1));
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
3145 exports.Symbol = Symbol; 3145 exports.Symbol = Symbol;
3146 exports.Type = Type; 3146 exports.Type = Type;
3147 exports.$forEach = $forEach; 3147 exports.$forEach = $forEach;
3148 exports.$map = $map; 3148 exports.$map = $map;
3149 exports.$toList = $toList; 3149 exports.$toList = $toList;
3150 exports.$isEmpty = $isEmpty; 3150 exports.$isEmpty = $isEmpty;
3151 exports.$removeLast = $removeLast; 3151 exports.$removeLast = $removeLast;
3152 exports.$fold = $fold; 3152 exports.$fold = $fold;
3153 exports.Uri = Uri; 3153 exports.Uri = Uri;
3154 })(core || (core = {})); 3154 })(core || (core = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/convert.js ('k') | lib/runtime/dart/isolate.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698