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

Unified Diff: src/string.js

Issue 1344893002: [builtins] Unify the String constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/runtime/runtime-symbol.cc ('k') | src/symbol.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index e6671eec17d991ce8d4a5ae9a8e800bd76f8ead6..039a2b8d54ba7f7b291c0076c2b83b985e7e48cc 100644
--- a/src/string.js
+++ b/src/string.js
@@ -18,7 +18,6 @@ var InternalPackedArray = utils.InternalPackedArray;
var RegExpExec;
var RegExpExecNoTests;
var RegExpLastMatchInfo;
-var SymbolToString;
var ToNumber;
var ToString;
@@ -28,26 +27,12 @@ utils.Import(function(from) {
RegExpExec = from.RegExpExec;
RegExpExecNoTests = from.RegExpExecNoTests;
RegExpLastMatchInfo = from.RegExpLastMatchInfo;
- SymbolToString = from.SymbolToString;
ToNumber = from.ToNumber;
ToString = from.ToString;
});
//-------------------------------------------------------------------
-function StringConstructor(x) {
- // TODO(bmeurer): Move this to toplevel.
- "use strict";
- if (%_ArgumentsLength() == 0) x = '';
- if (%_IsConstructCall()) {
- %_SetValueOf(this, TO_STRING_INLINE(x));
- } else {
- return IS_SYMBOL(x) ?
- %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x);
- }
-}
-
-
// ECMA-262 section 15.5.4.2
function StringToString() {
if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) {
@@ -1151,7 +1136,6 @@ function StringRaw(callSite) {
// -------------------------------------------------------------------
// Set the String function and constructor.
-%SetCode(GlobalString, StringConstructor);
%FunctionSetPrototype(GlobalString, new GlobalString());
// Set up the constructor property on the String prototype object.
« no previous file with comments | « src/runtime/runtime-symbol.cc ('k') | src/symbol.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698