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

Side by Side Diff: src/symbol.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 unified diff | Download patch
« no previous file with comments | « src/string.js ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 return %_ValueOf(this); 47 return %_ValueOf(this);
48 } 48 }
49 49
50 50
51 function SymbolToString() { 51 function SymbolToString() {
52 if (!(IS_SYMBOL(this) || IS_SYMBOL_WRAPPER(this))) { 52 if (!(IS_SYMBOL(this) || IS_SYMBOL_WRAPPER(this))) {
53 throw MakeTypeError(kIncompatibleMethodReceiver, 53 throw MakeTypeError(kIncompatibleMethodReceiver,
54 "Symbol.prototype.toString", this); 54 "Symbol.prototype.toString", this);
55 } 55 }
56 var description = %SymbolDescription(%_ValueOf(this)); 56 return %SymbolDescriptiveString(%_ValueOf(this));
57 return "Symbol(" + (IS_UNDEFINED(description) ? "" : description) + ")";
58 } 57 }
59 58
60 59
61 function SymbolValueOf() { 60 function SymbolValueOf() {
62 if (!(IS_SYMBOL(this) || IS_SYMBOL_WRAPPER(this))) { 61 if (!(IS_SYMBOL(this) || IS_SYMBOL_WRAPPER(this))) {
63 throw MakeTypeError(kIncompatibleMethodReceiver, 62 throw MakeTypeError(kIncompatibleMethodReceiver,
64 "Symbol.prototype.valueOf", this); 63 "Symbol.prototype.valueOf", this);
65 } 64 }
66 return %_ValueOf(this); 65 return %_ValueOf(this);
67 } 66 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ]); 135 ]);
137 136
138 // ------------------------------------------------------------------- 137 // -------------------------------------------------------------------
139 // Exports 138 // Exports
140 139
141 utils.Export(function(to) { 140 utils.Export(function(to) {
142 to.SymbolToString = SymbolToString; 141 to.SymbolToString = SymbolToString;
143 }) 142 })
144 143
145 }) 144 })
OLDNEW
« no previous file with comments | « src/string.js ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698