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

Commit

Permalink
Merge pull request #239 from arv/wrappers-as-expando
Browse files Browse the repository at this point in the history
Use an expando property for the wrapper.
  • Loading branch information
arv committed Sep 5, 2013
2 parents 52b9a34 + ba30170 commit 7d430a9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7d430a9

Please sign in to comment.