Skip to content

Commit e94afda

Browse files
mfloreasdumitriu
authored andcommitted
XWIKI-8193: Minor changes to prototype.js to make it more rewrite-friendly
1 parent 2a2fc85 commit e94afda

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
@@ -193,8 +193,8 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
193193
* A class that queries the document for elements that match a given CSS
194194
* selector.
195195
**/
196-
(function() {
197-
window.Selector = Class.create({
196+
var Selector = (function() {
197+
var Selector = Class.create({
198198
/** deprecated
199199
* new Selector(expression)
200200
* - expression (String): A CSS selector.
@@ -288,4 +288,5 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
288288
return Prototype.Selector.select(selector, element || document);
289289
}
290290
});
291+
return Selector;
291292
})();

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
@@ -54,7 +54,7 @@ Prototype._original_property = window.Sizzle;
5454
Prototype.Selector.engine = engine;
5555
Prototype.Selector.select = select;
5656
Prototype.Selector.match = match;
57-
})(Sizzle);
57+
})(window.Sizzle);
5858

5959
// Restore globals.
6060
window.Sizzle = Prototype._original_property;

0 commit comments

Comments
 (0)