Skip to content

Commit a4ceb5b

Browse files
Merge pull request prototypejs#326 from sdumitriu/XWIKI-8193
Minor changes to prototype.js to make it more rewrite-friendly
2 parents 5140d0c + e94afda commit a4ceb5b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/prototype/deprecated.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
158158
* A class that queries the document for elements that match a given CSS
159159
* selector.
160160
**/
161-
(function() {
162-
window.Selector = Class.create({
161+
var Selector = (function() {
162+
var Selector = Class.create({
163163
/** deprecated
164164
* new Selector(expression)
165165
* - expression (String): A CSS selector.
@@ -253,4 +253,5 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
253253
return Prototype.Selector.select(selector, element || document);
254254
}
255255
});
256+
return Selector;
256257
})();

src/prototype/dom/selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
* $$('div:empty');
8484
* // -> all DIVs without content (i.e., whitespace-only)
8585
**/
86-
window.$$ = function() {
86+
var $$ = function() {
8787
var expression = $A(arguments).join(', ');
8888
return Prototype.Selector.select(expression, document);
8989
};

vendor/sizzle/selector_engine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Prototype._original_property = window.Sizzle;
5252
Prototype.Selector.engine = engine;
5353
Prototype.Selector.select = select;
5454
Prototype.Selector.match = match;
55-
})(Sizzle);
55+
})(window.Sizzle);
5656

5757
// Restore globals.
5858
window.Sizzle = Prototype._original_property;

0 commit comments

Comments
 (0)