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

Side by Side Diff: src/string.js

Issue 1318043002: Native context: do not put public symbols and flags on the js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix and rebase 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/runtime/runtime-internal.cc ('k') | src/string-iterator.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
11 11
12 var ArrayIndexOf; 12 var ArrayIndexOf;
13 var ArrayJoin; 13 var ArrayJoin;
14 var GlobalRegExp = global.RegExp; 14 var GlobalRegExp = global.RegExp;
15 var GlobalString = global.String; 15 var GlobalString = global.String;
16 var InternalArray = utils.InternalArray; 16 var InternalArray = utils.InternalArray;
17 var InternalPackedArray = utils.InternalPackedArray; 17 var InternalPackedArray = utils.InternalPackedArray;
18 var MathMax; 18 var MathMax;
19 var MathMin; 19 var MathMin;
20 var RegExpExec; 20 var RegExpExec;
21 var RegExpExecNoTests; 21 var RegExpExecNoTests;
22 var RegExpLastMatchInfo; 22 var RegExpLastMatchInfo;
23 var SymbolToString;
23 var ToNumber; 24 var ToNumber;
24 var ToString; 25 var ToString;
25 26
26 utils.Import(function(from) { 27 utils.Import(function(from) {
27 ArrayIndexOf = from.ArrayIndexOf; 28 ArrayIndexOf = from.ArrayIndexOf;
28 ArrayJoin = from.ArrayJoin; 29 ArrayJoin = from.ArrayJoin;
29 MathMax = from.MathMax; 30 MathMax = from.MathMax;
30 MathMin = from.MathMin; 31 MathMin = from.MathMin;
31 RegExpExec = from.RegExpExec; 32 RegExpExec = from.RegExpExec;
32 RegExpExecNoTests = from.RegExpExecNoTests; 33 RegExpExecNoTests = from.RegExpExecNoTests;
33 RegExpLastMatchInfo = from.RegExpLastMatchInfo; 34 RegExpLastMatchInfo = from.RegExpLastMatchInfo;
35 SymbolToString = from.SymbolToString;
34 ToNumber = from.ToNumber; 36 ToNumber = from.ToNumber;
35 ToString = from.ToString; 37 ToString = from.ToString;
36 }); 38 });
37 39
38 //------------------------------------------------------------------- 40 //-------------------------------------------------------------------
39 41
40 function StringConstructor(x) { 42 function StringConstructor(x) {
41 if (%_ArgumentsLength() == 0) x = ''; 43 if (%_ArgumentsLength() == 0) x = '';
42 if (%_IsConstructCall()) { 44 if (%_IsConstructCall()) {
43 %_SetValueOf(this, TO_STRING_INLINE(x)); 45 %_SetValueOf(this, TO_STRING_INLINE(x));
44 } else { 46 } else {
45 return IS_SYMBOL(x) ? 47 return IS_SYMBOL(x) ?
46 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x); 48 %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x);
47 } 49 }
48 } 50 }
49 51
50 52
51 // ECMA-262 section 15.5.4.2 53 // ECMA-262 section 15.5.4.2
52 function StringToString() { 54 function StringToString() {
53 if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) { 55 if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) {
54 throw MakeTypeError(kNotGeneric, 'String.prototype.toString'); 56 throw MakeTypeError(kNotGeneric, 'String.prototype.toString');
55 } 57 }
56 return %_ValueOf(this); 58 return %_ValueOf(this);
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 to.StringLastIndexOf = StringLastIndexOfJS; 1206 to.StringLastIndexOf = StringLastIndexOfJS;
1205 to.StringMatch = StringMatchJS; 1207 to.StringMatch = StringMatchJS;
1206 to.StringReplace = StringReplace; 1208 to.StringReplace = StringReplace;
1207 to.StringSlice = StringSlice; 1209 to.StringSlice = StringSlice;
1208 to.StringSplit = StringSplitJS; 1210 to.StringSplit = StringSplitJS;
1209 to.StringSubstr = StringSubstr; 1211 to.StringSubstr = StringSubstr;
1210 to.StringSubstring = StringSubstring; 1212 to.StringSubstring = StringSubstring;
1211 }); 1213 });
1212 1214
1213 }) 1215 })
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | src/string-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698