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

Side by Side Diff: src/string.js

Issue 1099573002: Migrate error messages, part 4 (v8natives.js). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix wrong assertion Created 5 years, 8 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/proxy.js ('k') | 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 var $stringCharAt; 5 var $stringCharAt;
6 var $stringIndexOf; 6 var $stringIndexOf;
7 var $stringSubstring; 7 var $stringSubstring;
8 8
9 (function() { 9 (function() {
10 10
(...skipping 11 matching lines...) Expand all
22 } else { 22 } else {
23 return IS_SYMBOL(x) ? 23 return IS_SYMBOL(x) ?
24 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x); 24 %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x);
25 } 25 }
26 } 26 }
27 27
28 28
29 // ECMA-262 section 15.5.4.2 29 // ECMA-262 section 15.5.4.2
30 function StringToString() { 30 function StringToString() {
31 if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) { 31 if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) {
32 throw new $TypeError('String.prototype.toString is not generic'); 32 throw MakeTypeError(kNotGeneric, 'String.prototype.toString');
33 } 33 }
34 return %_ValueOf(this); 34 return %_ValueOf(this);
35 } 35 }
36 36
37 37
38 // ECMA-262 section 15.5.4.3 38 // ECMA-262 section 15.5.4.3
39 function StringValueOf() { 39 function StringValueOf() {
40 if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) { 40 if (!IS_STRING(this) && !IS_STRING_WRAPPER(this)) {
41 throw new $TypeError('String.prototype.valueOf is not generic'); 41 throw MakeTypeError(kNotGeneric, 'String.prototype.valueOf');
42 } 42 }
43 return %_ValueOf(this); 43 return %_ValueOf(this);
44 } 44 }
45 45
46 46
47 // ECMA-262, section 15.5.4.4 47 // ECMA-262, section 15.5.4.4
48 function StringCharAtJS(pos) { 48 function StringCharAtJS(pos) {
49 CHECK_OBJECT_COERCIBLE(this, "String.prototype.charAt"); 49 CHECK_OBJECT_COERCIBLE(this, "String.prototype.charAt");
50 50
51 var result = %_StringCharAt(this, pos); 51 var result = %_StringCharAt(this, pos);
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 "strike", StringStrike, 1174 "strike", StringStrike,
1175 "sub", StringSub, 1175 "sub", StringSub,
1176 "sup", StringSup 1176 "sup", StringSup
1177 ]); 1177 ]);
1178 1178
1179 $stringCharAt = StringCharAtJS; 1179 $stringCharAt = StringCharAtJS;
1180 $stringIndexOf = StringIndexOfJS; 1180 $stringIndexOf = StringIndexOfJS;
1181 $stringSubstring = StringSubstring; 1181 $stringSubstring = StringSubstring;
1182 1182
1183 })(); 1183 })();
OLDNEW
« no previous file with comments | « src/proxy.js ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698