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

Side by Side Diff: src/messages.js

Issue 6902104: Don't exchange null and undefined with the global object in function.prototype.{call, apply} for ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
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 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 var message = %_CallFunction(this, "message", ObjectHasOwnProperty) 1062 var message = %_CallFunction(this, "message", ObjectHasOwnProperty)
1063 ? (": " + this.message) 1063 ? (": " + this.message)
1064 : ""; 1064 : "";
1065 return this.name + message; 1065 return this.name + message;
1066 } finally { 1066 } finally {
1067 visited_errors.length = visited_errors.length - 1; 1067 visited_errors.length = visited_errors.length - 1;
1068 } 1068 }
1069 } 1069 }
1070 1070
1071 function errorToString() { 1071 function errorToString() {
1072 if (IS_NULL_OR_UNDEFINED(this)) {
1073 throw MakeTypeError("obj_ctor_property_non_object", ["toString"]);
1074 }
1072 // This helper function is needed because access to properties on 1075 // This helper function is needed because access to properties on
1073 // the builtins object do not work inside of a catch clause. 1076 // the builtins object do not work inside of a catch clause.
1074 function isCyclicErrorMarker(o) { return o === cyclic_error_marker; } 1077 function isCyclicErrorMarker(o) { return o === cyclic_error_marker; }
1075 1078
1076 try { 1079 try {
1077 return %_CallFunction(this, errorToStringDetectCycle); 1080 return %_CallFunction(this, errorToStringDetectCycle);
1078 } catch(e) { 1081 } catch(e) {
1079 // If this error message was encountered already return the empty 1082 // If this error message was encountered already return the empty
1080 // string for it instead of recursively formatting it. 1083 // string for it instead of recursively formatting it.
1081 if (isCyclicErrorMarker(e)) return ''; 1084 if (isCyclicErrorMarker(e)) return '';
1082 else throw e; 1085 else throw e;
1083 } 1086 }
1084 } 1087 }
1085 1088
1086 1089
1087 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', errorToString]); 1090 InstallFunctions($Error.prototype, DONT_ENUM, ['toString', errorToString]);
1088 1091
1089 // Boilerplate for exceptions for stack overflows. Used from 1092 // Boilerplate for exceptions for stack overflows. Used from
1090 // Isolate::StackOverflow(). 1093 // Isolate::StackOverflow().
1091 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); 1094 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []);
OLDNEW
« src/ia32/builtins-ia32.cc ('K') | « src/ia32/builtins-ia32.cc ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698