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

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

Issue 1348453004: fix some errors in our SDK, mostly around numbers (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 5 years, 3 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 dart_library.library('dart/_js_helper', null, /* Imports */[ 1 dart_library.library('dart/_js_helper', null, /* Imports */[
2 "dart_runtime/dart", 2 "dart_runtime/dart",
3 'dart/core', 3 'dart/core',
4 'dart/collection', 4 'dart/collection',
5 'dart/_interceptors', 5 'dart/_interceptors',
6 'dart/_foreign_helper' 6 'dart/_foreign_helper'
7 ], /* Lazy imports */[ 7 ], /* Lazy imports */[
8 ], function(exports, dart, core, collection, _interceptors, _foreign_helper) { 8 ], function(exports, dart, core, collection, _interceptors, _foreign_helper) {
9 'use strict'; 9 'use strict';
10 let dartx = dart.dartx; 10 let dartx = dart.dartx;
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 } 815 }
816 static valueFromDateString(str) { 816 static valueFromDateString(str) {
817 if (!(typeof str == 'string')) 817 if (!(typeof str == 'string'))
818 dart.throw(new core.ArgumentError(str)); 818 dart.throw(new core.ArgumentError(str));
819 let value = Date.parse(str); 819 let value = Date.parse(str);
820 if (dart.notNull(value[dartx.isNaN])) 820 if (dart.notNull(value[dartx.isNaN]))
821 dart.throw(new core.ArgumentError(str)); 821 dart.throw(new core.ArgumentError(str));
822 return value; 822 return value;
823 } 823 }
824 static getProperty(object, key) { 824 static getProperty(object, key) {
825 if (object == null || typeof object == 'boolean' || dart.is(object, core.n um) || typeof object == 'string') { 825 if (object == null || typeof object == 'boolean' || typeof object == 'numb er' || typeof object == 'string') {
826 dart.throw(new core.ArgumentError(object)); 826 dart.throw(new core.ArgumentError(object));
827 } 827 }
828 return object[key]; 828 return object[key];
829 } 829 }
830 static setProperty(object, key, value) { 830 static setProperty(object, key, value) {
831 if (object == null || typeof object == 'boolean' || dart.is(object, core.n um) || typeof object == 'string') { 831 if (object == null || typeof object == 'boolean' || typeof object == 'numb er' || typeof object == 'string') {
832 dart.throw(new core.ArgumentError(object)); 832 dart.throw(new core.ArgumentError(object));
833 } 833 }
834 object[key] = value; 834 object[key] = value;
835 } 835 }
836 static identicalImplementation(a, b) { 836 static identicalImplementation(a, b) {
837 return a == null ? b == null : a === b; 837 return a == null ? b == null : a === b;
838 } 838 }
839 static extractStackTrace(error) { 839 static extractStackTrace(error) {
840 return getTraceFromException(error.$thrownJsError); 840 return getTraceFromException(error.$thrownJsError);
841 } 841 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 return receiver.lastIndexOf(element, start); 888 return receiver.lastIndexOf(element, start);
889 } 889 }
890 dart.fn(stringLastIndexOfUnchecked); 890 dart.fn(stringLastIndexOfUnchecked);
891 function checkNull(object) { 891 function checkNull(object) {
892 if (object == null) 892 if (object == null)
893 dart.throw(new core.ArgumentError(null)); 893 dart.throw(new core.ArgumentError(null));
894 return object; 894 return object;
895 } 895 }
896 dart.fn(checkNull); 896 dart.fn(checkNull);
897 function checkNum(value) { 897 function checkNum(value) {
898 if (!dart.is(value, core.num)) { 898 if (!(typeof value == 'number')) {
899 dart.throw(new core.ArgumentError(value)); 899 dart.throw(new core.ArgumentError(value));
900 } 900 }
901 return value; 901 return value;
902 } 902 }
903 dart.fn(checkNum); 903 dart.fn(checkNum);
904 function checkInt(value) { 904 function checkInt(value) {
905 if (!(typeof value == 'number')) { 905 if (!(typeof value == 'number')) {
906 dart.throw(new core.ArgumentError(value)); 906 dart.throw(new core.ArgumentError(value));
907 } 907 }
908 return value; 908 return value;
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 exports.CastErrorImplementation = CastErrorImplementation; 1242 exports.CastErrorImplementation = CastErrorImplementation;
1243 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; 1243 exports.FallThroughErrorImplementation = FallThroughErrorImplementation;
1244 exports.RuntimeError = RuntimeError; 1244 exports.RuntimeError = RuntimeError;
1245 exports.random64 = random64; 1245 exports.random64 = random64;
1246 exports.jsonEncodeNative = jsonEncodeNative; 1246 exports.jsonEncodeNative = jsonEncodeNative;
1247 exports.SyncIterator$ = SyncIterator$; 1247 exports.SyncIterator$ = SyncIterator$;
1248 exports.SyncIterator = SyncIterator; 1248 exports.SyncIterator = SyncIterator;
1249 exports.SyncIterable$ = SyncIterable$; 1249 exports.SyncIterable$ = SyncIterable$;
1250 exports.SyncIterable = SyncIterable; 1250 exports.SyncIterable = SyncIterable;
1251 }); 1251 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698