From 2f9bde3ad5a2e3dd104c812b6c81f4077fe0aa1e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 6 Apr 2010 14:50:18 -0700 Subject: [PATCH] prototype: Simplify the NWMatcher adapter and optimize it for browsers that don't need to extend DOM elements. [jddalton] --- vendor/nwmatcher/selector_engine.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vendor/nwmatcher/selector_engine.js b/vendor/nwmatcher/selector_engine.js index e840c273b..9b0fae991 100644 --- a/vendor/nwmatcher/selector_engine.js +++ b/vendor/nwmatcher/selector_engine.js @@ -2,8 +2,12 @@ Prototype._original_property = window.NW; //= require "repository/src/nwmatcher" Prototype.Selector = (function(engine) { - function select(selector, scope) { - return engine.select(selector, scope || document, Element.extend); + var select = engine.select; + + if (Element.extend !== Prototype.K) { + select = function select(selector, scope) { + return engine.select(selector, scope, Element.extend); + }; } return {