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

Side by Side Diff: src/mirror-debugger.js

Issue 8341021: Fix Error.prototype.toString to be ES5 conform. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Lasse Reichstein. Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/cyclic-error-to-string.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 */ 1080 */
1081 ErrorMirror.prototype.message = function() { 1081 ErrorMirror.prototype.message = function() {
1082 return this.value_.message; 1082 return this.value_.message;
1083 }; 1083 };
1084 1084
1085 1085
1086 ErrorMirror.prototype.toText = function() { 1086 ErrorMirror.prototype.toText = function() {
1087 // Use the same text representation as in messages.js. 1087 // Use the same text representation as in messages.js.
1088 var text; 1088 var text;
1089 try { 1089 try {
1090 str = %_CallFunction(this.value_, builtins.errorToString); 1090 str = %_CallFunction(this.value_, builtins.ErrorToString);
1091 } catch (e) { 1091 } catch (e) {
1092 str = '#<Error>'; 1092 str = '#<Error>';
1093 } 1093 }
1094 return str; 1094 return str;
1095 } 1095 }
1096 1096
1097 1097
1098 /** 1098 /**
1099 * Base mirror object for properties. 1099 * Base mirror object for properties.
1100 * @param {ObjectMirror} mirror The mirror object having this property 1100 * @param {ObjectMirror} mirror The mirror object having this property
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 } 2420 }
2421 if (!NUMBER_IS_FINITE(value)) { 2421 if (!NUMBER_IS_FINITE(value)) {
2422 if (value > 0) { 2422 if (value > 0) {
2423 return 'Infinity'; 2423 return 'Infinity';
2424 } else { 2424 } else {
2425 return '-Infinity'; 2425 return '-Infinity';
2426 } 2426 }
2427 } 2427 }
2428 return value; 2428 return value;
2429 } 2429 }
OLDNEW
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/cyclic-error-to-string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698