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

Unified Diff: src/array.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 | « no previous file | src/array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index bf24d16d11bd7da9fe48cade405f590c96c66243..8e01394587ec7c63e8b7ecc240e44299de332ed4 100644
--- a/src/array.js
+++ b/src/array.js
@@ -196,7 +196,7 @@
// Assumes x is a non-string.
if (IS_NUMBER(x)) return %_NumberToString(x);
if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
- return (IS_NULL_OR_UNDEFINED(x)) ? '' : $toString($defaultString(x));
+ return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x));
}
@@ -207,8 +207,8 @@
// According to ES5, section 15.4.4.3, the toLocaleString conversion
// must throw a TypeError if ToObject(e).toLocaleString isn't
// callable.
- var e_obj = $toObject(e);
- return $toString(e_obj.toLocaleString());
+ var e_obj = ToObject(e);
+ return %ToString(e_obj.toLocaleString());
}
}
@@ -368,7 +368,7 @@
}
array = this;
} else {
- array = $toObject(this);
+ array = ToObject(this);
func = array.join;
}
if (!IS_SPEC_FUNCTION(func)) {
@@ -379,7 +379,7 @@
function ArrayToLocaleString() {
- var array = $toObject(this);
+ var array = ToObject(this);
var arrayLen = array.length;
var len = TO_UINT32(arrayLen);
if (len === 0) return "";
@@ -395,7 +395,7 @@
if (IS_UNDEFINED(separator)) {
separator = ',';
} else if (!IS_STRING(separator)) {
- separator = $nonStringToString(separator);
+ separator = NonStringToString(separator);
}
var result = %_FastOneByteArrayJoin(array, separator);
@@ -406,7 +406,7 @@
var e = array[0];
if (IS_STRING(e)) return e;
if (IS_NULL_OR_UNDEFINED(e)) return '';
- return $nonStringToString(e);
+ return NonStringToString(e);
}
return Join(array, length, separator, ConvertToString);
@@ -447,7 +447,7 @@
n--;
var value = array[n];
- $delete(array, $toName(n), true);
+ $delete(array, ToName(n), true);
array.length = n;
return value;
}
@@ -501,7 +501,7 @@
function ArrayConcatJS(arg1) { // length == 1
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.concat");
- var array = $toObject(this);
+ var array = ToObject(this);
var arg_count = %_ArgumentsLength();
var arrays = new InternalArray(1 + arg_count);
arrays[0] = array;
@@ -866,8 +866,8 @@
if (%_IsSmi(x) && %_IsSmi(y)) {
return %SmiLexicographicCompare(x, y);
}
- x = $toString(x);
- y = $toString(y);
+ x = ToString(x);
+ y = ToString(y);
if (x == y) return 0;
else return x < y ? -1 : 1;
};
@@ -1148,8 +1148,8 @@
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
- var array = $toObject(this);
- var length = $toUint32(array.length);
+ var array = ToObject(this);
+ var length = ToUint32(array.length);
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
@@ -1169,7 +1169,7 @@
var element = array[i];
// Prepare break slots for debugger step in.
if (stepping) %DebugPrepareStepInIfStepping(f);
- var new_receiver = needs_wrapper ? $toObject(receiver) : receiver;
+ var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
if (%_CallFunction(new_receiver, element, i, array, f)) {
accumulator[accumulator_length++] = element;
}
@@ -1185,7 +1185,7 @@
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
- var array = $toObject(this);
+ var array = ToObject(this);
var length = TO_UINT32(array.length);
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
@@ -1203,7 +1203,7 @@
var element = array[i];
// Prepare break slots for debugger step in.
if (stepping) %DebugPrepareStepInIfStepping(f);
- var new_receiver = needs_wrapper ? $toObject(receiver) : receiver;
+ var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
%_CallFunction(new_receiver, element, i, array, f);
}
}
@@ -1217,7 +1217,7 @@
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
- var array = $toObject(this);
+ var array = ToObject(this);
var length = TO_UINT32(array.length);
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
@@ -1235,7 +1235,7 @@
var element = array[i];
// Prepare break slots for debugger step in.
if (stepping) %DebugPrepareStepInIfStepping(f);
- var new_receiver = needs_wrapper ? $toObject(receiver) : receiver;
+ var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
if (%_CallFunction(new_receiver, element, i, array, f)) return true;
}
}
@@ -1248,7 +1248,7 @@
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
- var array = $toObject(this);
+ var array = ToObject(this);
var length = TO_UINT32(array.length);
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
@@ -1266,7 +1266,7 @@
var element = array[i];
// Prepare break slots for debugger step in.
if (stepping) %DebugPrepareStepInIfStepping(f);
- var new_receiver = needs_wrapper ? $toObject(receiver) : receiver;
+ var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
if (!%_CallFunction(new_receiver, element, i, array, f)) return false;
}
}
@@ -1279,7 +1279,7 @@
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
- var array = $toObject(this);
+ var array = ToObject(this);
var length = TO_UINT32(array.length);
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
@@ -1299,7 +1299,7 @@
var element = array[i];
// Prepare break slots for debugger step in.
if (stepping) %DebugPrepareStepInIfStepping(f);
- var new_receiver = needs_wrapper ? $toObject(receiver) : receiver;
+ var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
accumulator[i] = %_CallFunction(new_receiver, element, i, array, f);
}
}
@@ -1423,8 +1423,8 @@
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
- var array = $toObject(this);
- var length = $toUint32(array.length);
+ var array = ToObject(this);
+ var length = ToUint32(array.length);
if (!IS_SPEC_FUNCTION(callback)) {
throw MakeTypeError(kCalledNonCallable, callback);
@@ -1460,8 +1460,8 @@
// Pull out the length so that side effects are visible before the
// callback function is checked.
- var array = $toObject(this);
- var length = $toUint32(array.length);
+ var array = ToObject(this);
+ var length = ToUint32(array.length);
if (!IS_SPEC_FUNCTION(callback)) {
throw MakeTypeError(kCalledNonCallable, callback);
« no previous file with comments | « no previous file | src/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698