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

Unified Diff: src/typedarray.js

Issue 1123353004: 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 926920427275132efa4ead35d2a634b1d1dd656c..9f0f03e585de213ebd4fe2a6484d8ec70495d21a 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,6 +392,10 @@
FUNCTION(Float64)
endmacro
+function ToPositiveDataViewOffset(offset) {
+ return ToPositiveInteger(offset, kInvalidDataViewAccessorOffset);
+}
+
macro DATA_VIEW_GETTER_SETTER(TYPENAME)
function DataViewGetTYPENAMEJS(offset, little_endian) {
@@ -400,8 +404,9 @@
'DataView.getTYPENAME', this);
}
if (%_ArgumentsLength() < 1) throw MakeTypeError(kInvalidArgument);
- offset = $toPositiveInteger(offset, kInvalidDataViewAccessorOffset);
- return %DataViewGetTYPENAME(this, offset, !!little_endian);
+ return %DataViewGetTYPENAME(this,
+ ToPositiveDataViewOffset(offset),
+ !!little_endian);
}
function DataViewSetTYPENAMEJS(offset, value, little_endian) {
@@ -410,8 +415,10 @@
'DataView.setTYPENAME', this);
}
if (%_ArgumentsLength() < 2) throw MakeTypeError(kInvalidArgument);
- offset = $toPositiveInteger(offset, kInvalidDataViewAccessorOffset);
- %DataViewSetTYPENAME(this, offset, TO_NUMBER_INLINE(value), !!little_endian);
+ %DataViewSetTYPENAME(this,
+ ToPositiveDataViewOffset(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