Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Last active October 8, 2015 01:01
Show Gist options
  • Save WebReflection/0e193457312b269ce1c4 to your computer and use it in GitHub Desktop.
Save WebReflection/0e193457312b269ce1c4 to your computer and use it in GitHub Desktop.

Revisions

  1. WebReflection revised this gist Jun 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -17,4 +17,4 @@ var WeakMap = WeakMap || (function (s, dP, hOP) {'use strict';
    }
    };
    return WeakMap;
    }(Symbol('WeakMap'), Object.defineProperty, Object.o.hasOwnProperty));
    }(Symbol('WeakMap'), Object.defineProperty, {}.hasOwnProperty));
  2. WebReflection revised this gist Jun 22, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    var WeakMap = WeakMap || (function (s, dP) {'use strict';
    var WeakMap = WeakMap || (function (s, dP, hOP) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    dP(this, s, {value: Symbol('WeakMap')});
    }
    @@ -10,11 +10,11 @@ var WeakMap = WeakMap || (function (s, dP) {'use strict';
    return o[this[s]];
    },
    has: function has(o) {
    return o.hasOwnProperty(this[s]);
    return hOP.call(o, this[s]);
    },
    set: function set(o, v) {
    dP(o, this[s], {configurable: true, value: v});
    }
    };
    return WeakMap;
    }(Symbol('WeakMap'), Object.defineProperty));
    }(Symbol('WeakMap'), Object.defineProperty, Object.o.hasOwnProperty));
  3. WebReflection revised this gist Jun 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ var WeakMap = WeakMap || (function (s, dP) {'use strict';
    return o[this[s]];
    },
    has: function has(o) {
    return -1 < Object.getOwnPropertySymbols(o).indexOf(this[s]);
    return o.hasOwnProperty(this[s]);
    },
    set: function set(o, v) {
    dP(o, this[s], {configurable: true, value: v});
  4. WebReflection revised this gist Jun 22, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    var WeakMap = WeakMap || (function (s) {'use strict';
    var WeakMap = WeakMap || (function (s, dP) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    Object.defineProperty(this, s, {value: Symbol('WeakMap')});
    dP(this, s, {value: Symbol('WeakMap')});
    }
    WeakMap.prototype = {
    'delete': function del(o) {
    @@ -13,8 +13,8 @@ var WeakMap = WeakMap || (function (s) {'use strict';
    return -1 < Object.getOwnPropertySymbols(o).indexOf(this[s]);
    },
    set: function set(o, v) {
    Object.defineProperty(o, this[s], {configurable: true, value: v});
    dP(o, this[s], {configurable: true, value: v});
    }
    };
    return WeakMap;
    }(Symbol('WeakMap')));
    }(Symbol('WeakMap'), Object.defineProperty));
  5. WebReflection revised this gist Jun 22, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    this[s] = Symbol('WeakMap');
    Object.defineProperty(this, s, {value: Symbol('WeakMap')});
    }
    WeakMap.prototype = {
    'delete': function del(o) {
    @@ -13,7 +13,7 @@ var WeakMap = WeakMap || (function (s) {'use strict';
    return -1 < Object.getOwnPropertySymbols(o).indexOf(this[s]);
    },
    set: function set(o, v) {
    o[this[s]] = v;
    Object.defineProperty(o, this[s], {configurable: true, value: v});
    }
    };
    return WeakMap;
  6. WebReflection revised this gist Apr 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    this[s] = Symbol('WeakMap');
    }
    WeakMap.prototype = { // constructor: WeakMap,
    WeakMap.prototype = {
    'delete': function del(o) {
    delete o[this[s]];
    },
  7. WebReflection revised this gist Apr 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    this[s] = Symbol('WeakMap');
    }
    WeakMap.prototype = {constructor: WeakMap,
    WeakMap.prototype = { // constructor: WeakMap,
    'delete': function del(o) {
    delete o[this[s]];
    },
  8. WebReflection revised this gist Apr 17, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@ var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    this[s] = Symbol('WeakMap');
    }
    WeakMap.prototype = {
    'delete': function (o) {
    WeakMap.prototype = {constructor: WeakMap,
    'delete': function del(o) {
    delete o[this[s]];
    },
    get: function get(o) {
  9. WebReflection revised this gist Apr 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - MIT
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    this[s] = Symbol('WeakMap');
    }
    WeakMap.prototype = {
  10. WebReflection revised this gist Apr 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    function WeakMap() { // by Andrea Giammarchi - MIT
    this[s] = Symbol('WeakMap');
    }
    WeakMap.prototype = {
  11. WebReflection created this gist Apr 17, 2015.
    20 changes: 20 additions & 0 deletions WeakMap.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    var WeakMap = WeakMap || (function (s) {'use strict';
    function WeakMap() { // by Andrea Giammarchi - WTFPL
    this[s] = Symbol('WeakMap');
    }
    WeakMap.prototype = {
    'delete': function (o) {
    delete o[this[s]];
    },
    get: function get(o) {
    return o[this[s]];
    },
    has: function has(o) {
    return -1 < Object.getOwnPropertySymbols(o).indexOf(this[s]);
    },
    set: function set(o, v) {
    o[this[s]] = v;
    }
    };
    return WeakMap;
    }(Symbol('WeakMap')));