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

Unified Diff: src/messages.js

Issue 10886012: Release stack trace data after firing Error.stack accessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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/cctest/test-heap.cc » ('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 4da38051f9200746250867e23f9cc4228c524178..a947bbfbe05aab380e6a78ca5b264d07f380ce63 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -766,18 +766,18 @@ function DefineOneShotAccessor(obj, name, fun) {
// Note that the accessors consistently operate on 'obj', not 'this'.
// Since the object may occur in someone else's prototype chain we
// can't rely on 'this' being the same as 'obj'.
- var hasBeenSet = false;
var value;
+ var getter_function = fun;
var getter = function() {
- if (hasBeenSet) {
+ if (getter_function == null) {
return value;
}
- hasBeenSet = true;
- value = fun(obj);
+ value = getter_function(obj);
+ getter_function = null;
return value;
};
var setter = function(v) {
- hasBeenSet = true;
+ getter_function = null;
value = v;
};
%DefineOrRedefineAccessorProperty(obj, name, getter, setter, DONT_ENUM);
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698