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

Side by Side Diff: src/messages.js

Issue 1072083002: [es6] don't "replace" Object.prototype.toString for --harmony-tostring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Final fixup... 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/heap/heap.h ('k') | src/runtime/runtime.h » ('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 // ------------------------------------------------------------------- 5 // -------------------------------------------------------------------
6 6
7 var kMessages = { 7 var kMessages = {
8 // Error 8 // Error
9 cyclic_proto: ["Cyclic __proto__ value"], 9 cyclic_proto: ["Cyclic __proto__ value"],
10 code_gen_from_strings: ["%0"], 10 code_gen_from_strings: ["%0"],
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (IS_FUNCTION(obj)) { 241 if (IS_FUNCTION(obj)) {
242 var str = %_CallFunction(obj, FunctionToString); 242 var str = %_CallFunction(obj, FunctionToString);
243 if (str.length > 128) { 243 if (str.length > 128) {
244 str = %_SubString(str, 0, 111) + "...<omitted>..." + 244 str = %_SubString(str, 0, 111) + "...<omitted>..." +
245 %_SubString(str, str.length - 2, str.length); 245 %_SubString(str, str.length - 2, str.length);
246 } 246 }
247 return str; 247 return str;
248 } 248 }
249 if (IS_SYMBOL(obj)) return %_CallFunction(obj, $symbolToString); 249 if (IS_SYMBOL(obj)) return %_CallFunction(obj, $symbolToString);
250 if (IS_OBJECT(obj) 250 if (IS_OBJECT(obj)
251 && %GetDataProperty(obj, "toString") === DefaultObjectToString) { 251 && %GetDataProperty(obj, "toString") === ObjectToString) {
252 var constructor = %GetDataProperty(obj, "constructor"); 252 var constructor = %GetDataProperty(obj, "constructor");
253 if (typeof constructor == "function") { 253 if (typeof constructor == "function") {
254 var constructorName = constructor.name; 254 var constructorName = constructor.name;
255 if (IS_STRING(constructorName) && constructorName !== "") { 255 if (IS_STRING(constructorName) && constructorName !== "") {
256 return "#<" + constructorName + ">"; 256 return "#<" + constructorName + ">";
257 } 257 }
258 } 258 }
259 } 259 }
260 if (CanBeSafelyTreatedAsAnErrorObject(obj)) { 260 if (CanBeSafelyTreatedAsAnErrorObject(obj)) {
261 return %_CallFunction(obj, ErrorToString); 261 return %_CallFunction(obj, ErrorToString);
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 function SetUpStackOverflowBoilerplate() { 1281 function SetUpStackOverflowBoilerplate() {
1282 var boilerplate = MakeRangeError('stack_overflow', []); 1282 var boilerplate = MakeRangeError('stack_overflow', []);
1283 1283
1284 %DefineAccessorPropertyUnchecked( 1284 %DefineAccessorPropertyUnchecked(
1285 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); 1285 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM);
1286 1286
1287 return boilerplate; 1287 return boilerplate;
1288 } 1288 }
1289 1289
1290 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); 1290 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate();
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698