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

Unified Diff: tool/input_sdk/private/js_helper.dart

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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tool/input_sdk/private/js_array.dart ('k') | tool/input_sdk/private/js_number.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/js_helper.dart
diff --git a/tool/input_sdk/private/js_helper.dart b/tool/input_sdk/private/js_helper.dart
index 17610aa98935b3046968b521abb0b43be02f2b3f..34e08ea40efd4d2b6294c17ef7f052a919e404bf 100644
--- a/tool/input_sdk/private/js_helper.dart
+++ b/tool/input_sdk/private/js_helper.dart
@@ -84,11 +84,11 @@ class Primitives {
if (match != null) {
if (match[hexIndex] != null) {
// Cannot fail because we know that the digits are all hex.
- return JS('num', r'parseInt(#, 16)', source);
+ return JS('int', r'parseInt(#, 16)', source);
}
if (match[decimalIndex] != null) {
// Cannot fail because we know that the digits are all decimal.
- return JS('num', r'parseInt(#, 10)', source);
+ return JS('int', r'parseInt(#, 10)', source);
}
return handleError(source);
}
@@ -100,7 +100,7 @@ class Primitives {
if (match != null) {
if (radix == 10 && match[decimalIndex] != null) {
// Cannot fail because we know that the digits are all decimal.
- return JS('num', r'parseInt(#, 10)', source);
+ return JS('int', r'parseInt(#, 10)', source);
}
if (radix < 10 || match[decimalIndex] == null) {
// We know that the characters must be ASCII as otherwise the
@@ -132,7 +132,7 @@ class Primitives {
}
}
if (match == null) return handleError(source);
- return JS('num', r'parseInt(#, #)', source, radix);
+ return JS('int', r'parseInt(#, #)', source, radix);
}
static double parseDouble(String source, double handleError(String source)) {
@@ -180,7 +180,7 @@ class Primitives {
return "Instance of '$name'";
}
- static num dateNow() => JS('int', r'Date.now()');
+ static int dateNow() => JS('int', r'Date.now()');
static void initTicker() {
if (timerFrequency != null) return;
« no previous file with comments | « tool/input_sdk/private/js_array.dart ('k') | tool/input_sdk/private/js_number.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698