Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/bindings/generator.cpp

Issue 29573044: Issue 5147 - Invalidate wrapper on delete (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: tweaked the test. Created Oct. 11, 2017, 2:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/bindings/generator.cpp
===================================================================
--- a/compiled/bindings/generator.cpp
+++ b/compiled/bindings/generator.cpp
@@ -379,16 +379,21 @@
{
this._pointer = pointer;
};
var proto = (superclass ? superclass.prototype : null);
result.prototype = Object.create(proto, Object.getOwnPropertyDescriptors(props));
result.prototype.delete = function()
{
Module._ReleaseRef(this._pointer + ref_counted_offset);
+ Object.defineProperty(this, "_pointer", {
+ get: function() {
+ throw new Error("Attempt to use deleted object");
+ },
+ });
};
return result;
}
)");
}
void printClass(const ClassInfo& cls)
{
« no previous file with comments | « no previous file | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld