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

Unified Diff: src/runtime.js

Issue 1323543002: [runtime] Replace %to_string_fun with %_ToString. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ToStringStub
Patch Set: REBASE. Fixes 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 | « src/regexp.js ('k') | src/runtime/runtime-date.cc » ('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 e2eec4f17e9c61594c236846691d3047800657c6..f0bc13340b62f3050443afdc3e56e810d77b6637 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -14,14 +14,12 @@
var $defaultString;
var $NaN;
var $nonNumberToNumber;
-var $nonStringToString;
var $sameValue;
var $sameValueZero;
var $toInteger;
var $toLength;
var $toNumber;
var $toPositiveInteger;
-var $toString;
var harmony_tolength = false;
@@ -47,8 +45,7 @@ function APPLY_PREPARE(args) {
// First check that the receiver is callable.
if (!IS_CALLABLE(this)) {
- throw %make_type_error(kApplyNonFunction, %to_string_fun(this),
- typeof this);
+ throw %make_type_error(kApplyNonFunction, TO_STRING(this), typeof this);
}
// First check whether length is a positive Smi and args is an
@@ -84,8 +81,7 @@ function REFLECT_APPLY_PREPARE(args) {
// First check that the receiver is callable.
if (!IS_CALLABLE(this)) {
- throw %make_type_error(kApplyNonFunction, %to_string_fun(this),
- typeof this);
+ throw %make_type_error(kApplyNonFunction, TO_STRING(this), typeof this);
}
// First check whether length is a positive Smi and args is an
@@ -134,17 +130,17 @@ function REFLECT_CONSTRUCT_PREPARE(
if (!ctorOk) {
if (!IS_CALLABLE(this)) {
- throw %make_type_error(kCalledNonCallable, %to_string_fun(this));
+ throw %make_type_error(kCalledNonCallable, TO_STRING(this));
} else {
- throw %make_type_error(kNotConstructor, %to_string_fun(this));
+ throw %make_type_error(kNotConstructor, TO_STRING(this));
}
}
if (!newTargetOk) {
if (!IS_CALLABLE(newTarget)) {
- throw %make_type_error(kCalledNonCallable, %to_string_fun(newTarget));
+ throw %make_type_error(kCalledNonCallable, TO_STRING(newTarget));
} else {
- throw %make_type_error(kNotConstructor, %to_string_fun(newTarget));
+ throw %make_type_error(kNotConstructor, TO_STRING(newTarget));
}
}
@@ -220,14 +216,6 @@ function ToString(x) {
return (IS_NULL(x)) ? 'null' : ToString(DefaultString(x));
}
-function NonStringToString(x) {
- if (IS_NUMBER(x)) return %_NumberToString(x);
- if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
- if (IS_UNDEFINED(x)) return 'undefined';
- // Types that can't be converted to string are caught in DefaultString.
- return (IS_NULL(x)) ? 'null' : ToString(DefaultString(x));
-}
-
// ECMA-262, section 9.4, page 34.
function ToInteger(x) {
@@ -360,14 +348,12 @@ function ToPositiveInteger(x, rangeErrorIndex) {
$defaultString = DefaultString;
$NaN = %GetRootNaN();
$nonNumberToNumber = NonNumberToNumber;
-$nonStringToString = NonStringToString;
$sameValue = SameValue;
$sameValueZero = SameValueZero;
$toInteger = ToInteger;
$toLength = ToLength;
$toNumber = ToNumber;
$toPositiveInteger = ToPositiveInteger;
-$toString = ToString;
%InstallToContext([
"apply_prepare_builtin", APPLY_PREPARE,
@@ -379,11 +365,9 @@ $toString = ToString;
%InstallToContext([
"concat_iterable_to_array", ConcatIterableToArray,
"non_number_to_number", NonNumberToNumber,
- "non_string_to_string", NonStringToString,
"to_integer_fun", ToInteger,
"to_length_fun", ToLength,
"to_number_fun", ToNumber,
- "to_string_fun", ToString,
]);
utils.Export(function(to) {
« no previous file with comments | « src/regexp.js ('k') | src/runtime/runtime-date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698