[Pkg-mozext-commits] [adblock-plus] 109/464: Properly documented prototype chain rewriting
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:44:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit 0048f17e10e7332e3c1d56efc5a38ec22c04ef43
Author: Wladimir Palant <trev at adblockplus.org>
Date: Tue Dec 7 18:22:05 2010 +0100
Properly documented prototype chain rewriting
---
scripts/abprewrite.js | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/scripts/abprewrite.js b/scripts/abprewrite.js
index 88cab99..986f534 100644
--- a/scripts/abprewrite.js
+++ b/scripts/abprewrite.js
@@ -285,6 +285,32 @@ let modifier =
{
if (stmt.rhs && stmt.rhs.type == "ObjectLiteral" && stmt.rhs.setters)
{
+ // Convert prototype chains:
+ // Foo.prototype = {
+ // __proto__: Bar.prototype,
+ // ...
+ // };
+ //
+ // Change into:
+ // Foo.prototype = _extend44(Bar, {
+ // ...
+ // });
+ //
+ // Also changes the superclass constructor to allow instantiation without
+ // running initialization:
+ // function Bar() {
+ // ...
+ // }
+ //
+ // Change into:
+ // function Bar() {
+ // if (arguments[0] == _extendInitiated55)
+ // return;
+ // ...
+ // }
+ //
+ // Any __proto__ entries not pointing to a function (__proto__: null) are
+ // removed.
let parent = null;
for (let i = 0; i < stmt.rhs.setters.length; i++)
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list