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

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

Issue 1143953004: Fixes for sunflower (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: 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
« no previous file with comments | « no previous file | lib/runtime/dart_runtime.js » ('j') | lib/runtime/dart_runtime.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var _js_helper = dart.defineLibrary(_js_helper, {}); 1 var _js_helper = dart.defineLibrary(_js_helper, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var collection = dart.import(collection); 3 var collection = dart.import(collection);
4 var _internal = dart.import(_internal); 4 var _internal = dart.import(_internal);
5 var _foreign_helper = dart.import(_foreign_helper); 5 var _foreign_helper = dart.import(_foreign_helper);
6 var _js_embedded_names = dart.import(_js_embedded_names); 6 var _js_embedded_names = dart.import(_js_embedded_names);
7 var _interceptors = dart.lazyImport(_interceptors); 7 var _interceptors = dart.lazyImport(_interceptors);
8 var _js_names = dart.import(_js_names); 8 var _js_names = dart.import(_js_names);
9 var async = dart.import(async); 9 var async = dart.import(async);
10 var _isolate_helper = dart.lazyImport(_isolate_helper); 10 var _isolate_helper = dart.lazyImport(_isolate_helper);
(...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 hash = Math.random() * 0x3fffffff | 0; 1886 hash = Math.random() * 0x3fffffff | 0;
1887 object.$identityHash = hash; 1887 object.$identityHash = hash;
1888 } 1888 }
1889 return hash; 1889 return hash;
1890 } 1890 }
1891 static _throwFormatException(string) { 1891 static _throwFormatException(string) {
1892 throw new core.FormatException(string); 1892 throw new core.FormatException(string);
1893 } 1893 }
1894 static parseInt(source, radix, handleError) { 1894 static parseInt(source, radix, handleError) {
1895 if (handleError == null) 1895 if (handleError == null)
1896 handleError = dart.as(Primitives._throwFormatException, __CastType0); 1896 handleError = Primitives._throwFormatException;
1897 checkString(source); 1897 checkString(source);
1898 let match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source) ; 1898 let match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source) ;
1899 let digitsIndex = 1; 1899 let digitsIndex = 1;
1900 let hexIndex = 2; 1900 let hexIndex = 2;
1901 let decimalIndex = 3; 1901 let decimalIndex = 3;
1902 let nonDecimalHexIndex = 4; 1902 let nonDecimalHexIndex = 4;
1903 if (radix == null) { 1903 if (radix == null) {
1904 radix = 10; 1904 radix = 10;
1905 if (match != null) { 1905 if (match != null) {
1906 if (dart.dindex(match, hexIndex) != null) { 1906 if (dart.dindex(match, hexIndex) != null) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 } 1938 }
1939 } 1939 }
1940 } 1940 }
1941 if (match == null) 1941 if (match == null)
1942 return handleError(source); 1942 return handleError(source);
1943 return parseInt(source, radix); 1943 return parseInt(source, radix);
1944 } 1944 }
1945 static parseDouble(source, handleError) { 1945 static parseDouble(source, handleError) {
1946 checkString(source); 1946 checkString(source);
1947 if (handleError == null) 1947 if (handleError == null)
1948 handleError = dart.as(Primitives._throwFormatException, __CastType2); 1948 handleError = Primitives._throwFormatException;
1949 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s *$/.test(source)) { 1949 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s *$/.test(source)) {
1950 return handleError(source); 1950 return handleError(source);
1951 } 1951 }
1952 let result = parseFloat(source); 1952 let result = parseFloat(source);
1953 if (result.isNaN) { 1953 if (result.isNaN) {
1954 let trimmed = source.trim(); 1954 let trimmed = source.trim();
1955 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { 1955 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') {
1956 return result; 1956 return result;
1957 } 1957 }
1958 return handleError(source); 1958 return handleError(source);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 return a == null ? b == null : a === b; 2265 return a == null ? b == null : a === b;
2266 } 2266 }
2267 static extractStackTrace(error) { 2267 static extractStackTrace(error) {
2268 return getTraceFromException(error.$thrownJsError); 2268 return getTraceFromException(error.$thrownJsError);
2269 } 2269 }
2270 } 2270 }
2271 dart.setSignature(Primitives, { 2271 dart.setSignature(Primitives, {
2272 statics: () => ({ 2272 statics: () => ({
2273 initializeStatics: [dart.void, [core.int]], 2273 initializeStatics: [dart.void, [core.int]],
2274 objectHashCode: [core.int, [core.Object]], 2274 objectHashCode: [core.int, [core.Object]],
2275 _throwFormatException: [core.Object, [core.String]], 2275 _throwFormatException: [core.Null, [core.String]],
2276 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [ core.String])]], 2276 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [ core.String])]],
2277 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c ore.String])]], 2277 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c ore.String])]],
2278 formatType: [core.String, [core.String, core.List]], 2278 formatType: [core.String, [core.String, core.List]],
2279 objectTypeName: [core.String, [core.Object]], 2279 objectTypeName: [core.String, [core.Object]],
2280 objectToString: [core.String, [core.Object]], 2280 objectToString: [core.String, [core.Object]],
2281 dateNow: [core.num, []], 2281 dateNow: [core.num, []],
2282 initTicker: [dart.void, []], 2282 initTicker: [dart.void, []],
2283 currentUri: [core.String, []], 2283 currentUri: [core.String, []],
2284 _fromCharCodeApply: [core.String, [core.List$(core.int)]], 2284 _fromCharCodeApply: [core.String, [core.List$(core.int)]],
2285 stringFromCodePoints: [core.String, [core.Object]], 2285 stringFromCodePoints: [core.String, [core.Object]],
(...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 } 4147 }
4148 dart.fn(missingMain, dart.void, []); 4148 dart.fn(missingMain, dart.void, []);
4149 function badMain() { 4149 function badMain() {
4150 throw new MainError("'main' is not a function."); 4150 throw new MainError("'main' is not a function.");
4151 } 4151 }
4152 dart.fn(badMain, dart.void, []); 4152 dart.fn(badMain, dart.void, []);
4153 function mainHasTooManyParameters() { 4153 function mainHasTooManyParameters() {
4154 throw new MainError("'main' expects too many parameters."); 4154 throw new MainError("'main' expects too many parameters.");
4155 } 4155 }
4156 dart.fn(mainHasTooManyParameters, dart.void, []); 4156 dart.fn(mainHasTooManyParameters, dart.void, []);
4157 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.int , [core.String]));
4158 let __CastType2 = dart.typedef('__CastType2', () => dart.functionType(core.dou ble, [core.String]));
4159 // Exports: 4157 // Exports:
4160 exports.NoSideEffects = NoSideEffects; 4158 exports.NoSideEffects = NoSideEffects;
4161 exports.NoThrows = NoThrows; 4159 exports.NoThrows = NoThrows;
4162 exports.NoInline = NoInline; 4160 exports.NoInline = NoInline;
4163 exports.IrRepresentation = IrRepresentation; 4161 exports.IrRepresentation = IrRepresentation;
4164 exports.Native = Native; 4162 exports.Native = Native;
4165 exports.ConstantMap$ = ConstantMap$; 4163 exports.ConstantMap$ = ConstantMap$;
4166 exports.ConstantMap = ConstantMap; 4164 exports.ConstantMap = ConstantMap;
4167 exports.ConstantStringMap$ = ConstantStringMap$; 4165 exports.ConstantStringMap$ = ConstantStringMap$;
4168 exports.ConstantStringMap = ConstantStringMap; 4166 exports.ConstantStringMap = ConstantStringMap;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
4382 exports.jsonEncodeNative = jsonEncodeNative; 4380 exports.jsonEncodeNative = jsonEncodeNative;
4383 exports.getIsolateAffinityTag = getIsolateAffinityTag; 4381 exports.getIsolateAffinityTag = getIsolateAffinityTag;
4384 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; 4382 exports.LoadLibraryFunctionType = LoadLibraryFunctionType;
4385 exports.DeferredLoadCallback = DeferredLoadCallback; 4383 exports.DeferredLoadCallback = DeferredLoadCallback;
4386 exports.loadDeferredLibrary = loadDeferredLibrary; 4384 exports.loadDeferredLibrary = loadDeferredLibrary;
4387 exports.MainError = MainError; 4385 exports.MainError = MainError;
4388 exports.missingMain = missingMain; 4386 exports.missingMain = missingMain;
4389 exports.badMain = badMain; 4387 exports.badMain = badMain;
4390 exports.mainHasTooManyParameters = mainHasTooManyParameters; 4388 exports.mainHasTooManyParameters = mainHasTooManyParameters;
4391 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names, _interceptors, _js_names, async, _isolate_helper); 4389 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names, _interceptors, _js_names, async, _isolate_helper);
OLDNEW
« no previous file with comments | « no previous file | lib/runtime/dart_runtime.js » ('j') | lib/runtime/dart_runtime.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698