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

Unified Diff: src/messages.js

Issue 3082012: Handle accessors when generating Error.stack... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-798.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
===================================================================
--- src/messages.js (revision 5238)
+++ src/messages.js (working copy)
@@ -707,14 +707,20 @@
// See if we can find a unique property on the receiver that holds
// this function.
var ownName = this.fun.name;
- if (ownName && this.receiver && this.receiver[ownName] === this.fun)
+ if (ownName && this.receiver &&
+ (ObjectLookupGetter.call(this.receiver, ownName) === this.fun ||
+ ObjectLookupSetter.call(this.receiver, ownName) === this.fun ||
+ this.receiver[ownName] === this.fun)) {
// To handle DontEnum properties we guess that the method has
// the same name as the function.
return ownName;
+ }
var name = null;
for (var prop in this.receiver) {
- if (this.receiver[prop] === this.fun) {
- // If we find more than one match bail out to avoid confusion
+ if (this.receiver.__lookupGetter__(prop) === this.fun ||
+ this.receiver.__lookupSetter__(prop) === this.fun ||
+ (!this.receiver.__lookupGetter__(prop) && this.receiver[prop] === this.fun)) {
+ // If we find more than one match bail out to avoid confusion.
if (name)
return null;
name = prop;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-798.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698