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

Unified Diff: tool/input_sdk/private/js_string.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_number.dart ('k') | tool/input_sdk/private/native_typed_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/js_string.dart
diff --git a/tool/input_sdk/private/js_string.dart b/tool/input_sdk/private/js_string.dart
index f3a77e5b6a476f8938b904eb431dc5c3d556093e..4007b2fb4344ee7359ef592c7df26efa88e08bd0 100644
--- a/tool/input_sdk/private/js_string.dart
+++ b/tool/input_sdk/private/js_string.dart
@@ -18,7 +18,7 @@ class JSString extends Interceptor implements String, JSIndexable {
if (index is !int) throw new ArgumentError(index);
if (index < 0) throw new RangeError.value(index);
if (index >= length) throw new RangeError.value(index);
- return JS('JSUInt31', r'#.charCodeAt(#)', this, index);
+ return JS('int', r'#.charCodeAt(#)', this, index);
}
Iterable<Match> allMatches(String string, [int start = 0]) {
@@ -333,15 +333,15 @@ class JSString extends Interceptor implements String, JSIndexable {
String operator*(int times) {
if (0 >= times) return ''; // Unnecessary but hoists argument type check.
if (times == 1 || this.length == 0) return this;
- if (times != JS('JSUInt32', '# >>> 0', times)) {
+ if (times != JS('int', '# >>> 0', times)) {
// times >= 2^32. We can't create a string that big.
throw const OutOfMemoryError();
}
var result = '';
- var s = this;
+ String s = this;
while (true) {
if (times & 1 == 1) result = s + result;
- times = JS('JSUInt31', '# >>> 1', times);
+ times = JS('int', '# >>> 1', times);
if (times == 0) break;
s += s;
}
« no previous file with comments | « tool/input_sdk/private/js_number.dart ('k') | tool/input_sdk/private/native_typed_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698