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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 { 377 {
378 var result = function(pointer) 378 var result = function(pointer)
379 { 379 {
380 this._pointer = pointer; 380 this._pointer = pointer;
381 }; 381 };
382 var proto = (superclass ? superclass.prototype : null); 382 var proto = (superclass ? superclass.prototype : null);
383 result.prototype = Object.create(proto, Object.getOwnPropertyDescriptors (props)); 383 result.prototype = Object.create(proto, Object.getOwnPropertyDescriptors (props));
384 result.prototype.delete = function() 384 result.prototype.delete = function()
385 { 385 {
386 Module._ReleaseRef(this._pointer + ref_counted_offset); 386 Module._ReleaseRef(this._pointer + ref_counted_offset);
387 this._pointer = 0xdeadbeef;
Wladimir Palant 2017/10/11 07:45:51 This is unnecessary, you are overwriting the prope
388 Object.defineProperty(this, "_pointer", {
389 get: function() {
390 throw new Error("Deleted object"); return 0xdeadbeef;
Wladimir Palant 2017/10/11 07:45:51 return after throw is dead code. Nit: "Attemt to
391 },
392 });
387 }; 393 };
388 return result; 394 return result;
389 } 395 }
390 )"); 396 )");
391 } 397 }
392 398
393 void printClass(const ClassInfo& cls) 399 void printClass(const ClassInfo& cls)
394 { 400 {
395 // Begin class definition 401 // Begin class definition
396 bool singleton = !cls.instanceGetter.empty(); 402 bool singleton = !cls.instanceGetter.empty();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 482
477 void printBindings() 483 void printBindings()
478 { 484 {
479 bindings_internal::printHelpers(); 485 bindings_internal::printHelpers();
480 486
481 for (const auto& cls : classes) 487 for (const auto& cls : classes)
482 bindings_internal::printClass(cls); 488 bindings_internal::printClass(cls);
483 for (const auto& cls : classes) 489 for (const auto& cls : classes)
484 bindings_internal::printClassMapping(cls); 490 bindings_internal::printClassMapping(cls);
485 } 491 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld