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

Unified Diff: src/messages.js

Issue 46593010: Correctly load message from an Error object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-306220.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 0a301228d748cfe2260b7b00d97df8bd3df9d74d..bfd42de0ad9101220cc4c2c8fa0ba62d92c771f9 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -1247,23 +1247,24 @@ var visited_errors = new InternalArray();
var cyclic_error_marker = new $Object();
function GetPropertyWithoutInvokingMonkeyGetters(error, name) {
+ var current = error;
// Climb the prototype chain until we find the holder.
- while (error && !%HasLocalProperty(error, name)) {
- error = %GetPrototype(error);
+ while (current && !%HasLocalProperty(current, name)) {
+ current = %GetPrototype(current);
}
- if (IS_NULL(error)) return UNDEFINED;
- if (!IS_OBJECT(error)) return error[name];
+ if (IS_NULL(current)) return UNDEFINED;
+ if (!IS_OBJECT(current)) return error[name];
// If the property is an accessor on one of the predefined errors that can be
// generated statically by the compiler, don't touch it. This is to address
// http://code.google.com/p/chromium/issues/detail?id=69187
- var desc = %GetOwnProperty(error, name);
+ var desc = %GetOwnProperty(current, name);
if (desc && desc[IS_ACCESSOR_INDEX]) {
var isName = name === "name";
- if (error === $ReferenceError.prototype)
+ if (current === $ReferenceError.prototype)
return isName ? "ReferenceError" : UNDEFINED;
- if (error === $SyntaxError.prototype)
+ if (current === $SyntaxError.prototype)
return isName ? "SyntaxError" : UNDEFINED;
- if (error === $TypeError.prototype)
+ if (current === $TypeError.prototype)
return isName ? "TypeError" : UNDEFINED;
}
// Otherwise, read normally.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-306220.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698