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

Side by Side Diff: src/string.js

Issue 1347663002: [es6] Move builtin constructors for primitives to strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's comments 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 | « no previous file | src/v8natives.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 18 matching lines...) Expand all
29 RegExpExecNoTests = from.RegExpExecNoTests; 29 RegExpExecNoTests = from.RegExpExecNoTests;
30 RegExpLastMatchInfo = from.RegExpLastMatchInfo; 30 RegExpLastMatchInfo = from.RegExpLastMatchInfo;
31 SymbolToString = from.SymbolToString; 31 SymbolToString = from.SymbolToString;
32 ToNumber = from.ToNumber; 32 ToNumber = from.ToNumber;
33 ToString = from.ToString; 33 ToString = from.ToString;
34 }); 34 });
35 35
36 //------------------------------------------------------------------- 36 //-------------------------------------------------------------------
37 37
38 function StringConstructor(x) { 38 function StringConstructor(x) {
39 // TODO(bmeurer): Move this to toplevel.
40 "use strict";
39 if (%_ArgumentsLength() == 0) x = ''; 41 if (%_ArgumentsLength() == 0) x = '';
40 if (%_IsConstructCall()) { 42 if (%_IsConstructCall()) {
41 %_SetValueOf(this, TO_STRING_INLINE(x)); 43 %_SetValueOf(this, TO_STRING_INLINE(x));
42 } else { 44 } else {
43 return IS_SYMBOL(x) ? 45 return IS_SYMBOL(x) ?
44 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x); 46 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x);
45 } 47 }
46 } 48 }
47 49
48 50
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 to.StringLastIndexOf = StringLastIndexOfJS; 1220 to.StringLastIndexOf = StringLastIndexOfJS;
1219 to.StringMatch = StringMatchJS; 1221 to.StringMatch = StringMatchJS;
1220 to.StringReplace = StringReplace; 1222 to.StringReplace = StringReplace;
1221 to.StringSlice = StringSlice; 1223 to.StringSlice = StringSlice;
1222 to.StringSplit = StringSplitJS; 1224 to.StringSplit = StringSplitJS;
1223 to.StringSubstr = StringSubstr; 1225 to.StringSubstr = StringSubstr;
1224 to.StringSubstring = StringSubstring; 1226 to.StringSubstring = StringSubstring;
1225 }); 1227 });
1226 1228
1227 }) 1229 })
OLDNEW
« no previous file with comments | « no previous file | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698