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

Unified Diff: src/runtime.js

Issue 17572009: Update typed arrays behavior to match ES6 rev 15. Remove TO_POSITIVE_INTEGER and throw on negative … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 6 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 | « src/messages.js ('k') | src/typedarray.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 22f888d814194c92216cd933f3310c627ef664a5..348fd747f5b9171c45b493bc824d92a4ba725911 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -658,7 +658,6 @@ function DefaultNumber(x) {
throw %MakeTypeError('cannot_convert_to_primitive', []);
}
-
// ECMA-262, section 8.6.2.6, page 28.
function DefaultString(x) {
var toString = x.toString;
@@ -676,6 +675,12 @@ function DefaultString(x) {
throw %MakeTypeError('cannot_convert_to_primitive', []);
}
+function ToPositiveInteger(x, rangeErrorName) {
+ var i = TO_INTEGER(x);
+ if (i < 0) throw %MakeRangeError(rangeErrorName);
+ return i;
+}
+
// NOTE: Setting the prototype for Array must take place as early as
// possible due to code generation for array literals. When
« no previous file with comments | « src/messages.js ('k') | src/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698