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: Created Oct. 10, 2017, 9:50 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 | no next file » | 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,22 @@
{
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);
+ this._pointer = 0xdeadbeef;
Wladimir Palant 2017/10/11 07:45:51 This is unnecessary, you are overwriting the prope
+ Object.defineProperty(this, "_pointer", {
+ get: function() {
+ throw new Error("Deleted object"); return 0xdeadbeef;
Wladimir Palant 2017/10/11 07:45:51 return after throw is dead code. Nit: "Attemt to
+ },
+ });
};
return result;
}
)");
}
void printClass(const ClassInfo& cls)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld