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: tweaked the test. Created Oct. 11, 2017, 2:46 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 | test/filterClasses.js » ('j') | 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 Object.defineProperty(this, "_pointer", {
388 get: function() {
389 throw new Error("Attempt to use deleted object");
390 },
391 });
387 }; 392 };
388 return result; 393 return result;
389 } 394 }
390 )"); 395 )");
391 } 396 }
392 397
393 void printClass(const ClassInfo& cls) 398 void printClass(const ClassInfo& cls)
394 { 399 {
395 // Begin class definition 400 // Begin class definition
396 bool singleton = !cls.instanceGetter.empty(); 401 bool singleton = !cls.instanceGetter.empty();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 481
477 void printBindings() 482 void printBindings()
478 { 483 {
479 bindings_internal::printHelpers(); 484 bindings_internal::printHelpers();
480 485
481 for (const auto& cls : classes) 486 for (const auto& cls : classes)
482 bindings_internal::printClass(cls); 487 bindings_internal::printClass(cls);
483 for (const auto& cls : classes) 488 for (const auto& cls : classes)
484 bindings_internal::printClassMapping(cls); 489 bindings_internal::printClassMapping(cls);
485 } 490 }
OLDNEW
« 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