From ba30170d62423cbc3fff27a933f4b2ff8262d922 Mon Sep 17 00:00:00 2001 From: Erik Arvidsson Date: Thu, 5 Sep 2013 10:09:32 -0400 Subject: [PATCH] Use an expando property for the wrapper. --- src/wrappers.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/wrappers.js b/src/wrappers.js index f5fbcd2..8acdb47 100644 --- a/src/wrappers.js +++ b/src/wrappers.js @@ -7,7 +7,6 @@ var ShadowDOMPolyfill = {}; (function(scope) { 'use strict'; - var wrapperTable = new SideTable(); var constructorTable = new SideTable(); var nativePrototypeTable = new SideTable(); var wrappers = Object.create(null); @@ -237,10 +236,8 @@ var ShadowDOMPolyfill = {}; return null; assert(isNative(impl)); - var wrapper = wrapperTable.get(impl); - if (!wrapper) - wrapperTable.set(impl, wrapper = new (getWrapperConstructor(impl))(impl)); - return wrapper; + return impl.polymerWrapper_ || + (impl.polymerWrapper_ = new (getWrapperConstructor(impl))(impl)); } /** @@ -284,7 +281,7 @@ var ShadowDOMPolyfill = {}; return; assert(isNative(node)); assert(wrapper === undefined || isWrapper(wrapper)); - wrapperTable.set(node, wrapper); + node.polymerWrapper_ = wrapper; } function defineGetter(constructor, name, getter) {