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

Unified Diff: src/typedarray.js

Issue 1131843002: Revert of Revert of Wrap runtime.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/symbol.js ('k') | src/uri.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typedarray.js
diff --git a/src/typedarray.js b/src/typedarray.js
index 9f0f03e585de213ebd4fe2a6484d8ec70495d21a..926920427275132efa4ead35d2a634b1d1dd656c 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -38,10 +38,10 @@
function NAMEConstructByArrayBuffer(obj, buffer, byteOffset, length) {
if (!IS_UNDEFINED(byteOffset)) {
byteOffset =
- ToPositiveInteger(byteOffset, kInvalidTypedArrayLength);
+ $toPositiveInteger(byteOffset, kInvalidTypedArrayLength);
}
if (!IS_UNDEFINED(length)) {
- length = ToPositiveInteger(length, kInvalidTypedArrayLength);
+ length = $toPositiveInteger(length, kInvalidTypedArrayLength);
}
var bufferByteLength = %_ArrayBufferGetByteLength(buffer);
@@ -82,7 +82,7 @@
function NAMEConstructByLength(obj, length) {
var l = IS_UNDEFINED(length) ?
- 0 : ToPositiveInteger(length, kInvalidTypedArrayLength);
+ 0 : $toPositiveInteger(length, kInvalidTypedArrayLength);
if (l > %_MaxSmi()) {
throw MakeRangeError(kInvalidTypedArrayLength);
}
@@ -97,7 +97,7 @@
function NAMEConstructByArrayLike(obj, arrayLike) {
var length = arrayLike.length;
- var l = ToPositiveInteger(length, kInvalidTypedArrayLength);
+ var l = $toPositiveInteger(length, kInvalidTypedArrayLength);
if (l > %_MaxSmi()) {
throw MakeRangeError(kInvalidTypedArrayLength);
@@ -335,7 +335,7 @@
if (%_IsConstructCall()) {
if (!IS_ARRAYBUFFER(buffer)) throw MakeTypeError(kDataViewNotArrayBuffer);
if (!IS_UNDEFINED(byteOffset)) {
- byteOffset = ToPositiveInteger(byteOffset, kInvalidDataViewOffset);
+ byteOffset = $toPositiveInteger(byteOffset, kInvalidDataViewOffset);
}
if (!IS_UNDEFINED(byteLength)) {
byteLength = TO_INTEGER(byteLength);
@@ -392,10 +392,6 @@
FUNCTION(Float64)
endmacro
-function ToPositiveDataViewOffset(offset) {
- return ToPositiveInteger(offset, kInvalidDataViewAccessorOffset);
-}
-
macro DATA_VIEW_GETTER_SETTER(TYPENAME)
function DataViewGetTYPENAMEJS(offset, little_endian) {
@@ -404,9 +400,8 @@
'DataView.getTYPENAME', this);
}
if (%_ArgumentsLength() < 1) throw MakeTypeError(kInvalidArgument);
- return %DataViewGetTYPENAME(this,
- ToPositiveDataViewOffset(offset),
- !!little_endian);
+ offset = $toPositiveInteger(offset, kInvalidDataViewAccessorOffset);
+ return %DataViewGetTYPENAME(this, offset, !!little_endian);
}
function DataViewSetTYPENAMEJS(offset, value, little_endian) {
@@ -415,10 +410,8 @@
'DataView.setTYPENAME', this);
}
if (%_ArgumentsLength() < 2) throw MakeTypeError(kInvalidArgument);
- %DataViewSetTYPENAME(this,
- ToPositiveDataViewOffset(offset),
- TO_NUMBER_INLINE(value),
- !!little_endian);
+ offset = $toPositiveInteger(offset, kInvalidDataViewAccessorOffset);
+ %DataViewSetTYPENAME(this, offset, TO_NUMBER_INLINE(value), !!little_endian);
}
endmacro
« no previous file with comments | « src/symbol.js ('k') | src/uri.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698