| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 Loading... | |
| 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", { | 387 Object.defineProperty(this, "_pointer", { |
| 389 get: function() { | 388 get: function() { |
| 390 throw new Error("Deleted object"); return 0xdeadbeef; | 389 throw new Error("Attempt to use deleted object"); |
|
Wladimir Palant
2017/10/11 07:45:51
return after throw is dead code.
Nit: "Attemt to
| |
| 391 }, | 390 }, |
| 392 }); | 391 }); |
| 393 }; | 392 }; |
| 394 return result; | 393 return result; |
| 395 } | 394 } |
| 396 )"); | 395 )"); |
| 397 } | 396 } |
| 398 | 397 |
| 399 void printClass(const ClassInfo& cls) | 398 void printClass(const ClassInfo& cls) |
| 400 { | 399 { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 | 481 |
| 483 void printBindings() | 482 void printBindings() |
| 484 { | 483 { |
| 485 bindings_internal::printHelpers(); | 484 bindings_internal::printHelpers(); |
| 486 | 485 |
| 487 for (const auto& cls : classes) | 486 for (const auto& cls : classes) |
| 488 bindings_internal::printClass(cls); | 487 bindings_internal::printClass(cls); |
| 489 for (const auto& cls : classes) | 488 for (const auto& cls : classes) |
| 490 bindings_internal::printClassMapping(cls); | 489 bindings_internal::printClassMapping(cls); |
| 491 } | 490 } |
| LEFT | RIGHT |