Skip to content

Commit

Permalink
prototype: Simplify the NWMatcher adapter and optimize it for browser…
Browse files Browse the repository at this point in the history
…s that don't need to extend DOM elements. [jddalton]
  • Loading branch information
jdalton authored and kangax committed Apr 6, 2010
1 parent ece6e0e commit 2f9bde3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vendor/nwmatcher/selector_engine.js
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f9bde3

Please sign in to comment.