Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Faster Impl of Side Table
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Jul 10, 2013
1 parent 27b9cc6 commit dd83a79
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/template_element.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,15 @@

var SideTable;
"undefined" != typeof WeakMap && navigator.userAgent.indexOf("Firefox/") < 0 ? SideTable = WeakMap : function() {
var a = Object.defineProperty, b = Object.hasOwnProperty, c = new Date().getTime() % 1e9;
var c = new Date().getTime() % 1e9;
SideTable = function() {
this.name = "__st" + (1e9 * Math.random() >>> 0) + (c++ + "__");
}, SideTable.prototype = {
set: function(b, c) {
a(b, this.name, {
value: c,
writable: !0
});
set: function(key, value) {
key[this.name] = value;
},
get: function(a) {
return b.call(a, this.name) ? a[this.name] : void 0;
},
"delete": function(a) {
this.set(a, void 0);
get: function(key) {
return key[this.name];
}
};
}();
Expand Down Expand Up @@ -1260,7 +1254,7 @@

if (!this.inputs.size) {
// End iteration
templateIteratorTable.delete(this);
templateIteratorTable.set(this, undefined);
this.close();
}
},
Expand Down Expand Up @@ -1334,7 +1328,7 @@
var template = this.templateElement_;
if (!template.parentNode || !template.ownerDocument.defaultView) {
this.close();
templateIteratorTable.delete(this);
templateIteratorTable.set(this, undefined);
return;
}

Expand Down

0 comments on commit dd83a79

Please sign in to comment.