Replace all instances of foo.__proto__ by foo['__proto__'] for Caja-compliance.

This commit is contained in:
Tobie Langel 2008-05-05 09:37:43 +02:00
parent de5cc4a0f9
commit 9c8d9d89d6
4 changed files with 9 additions and 7 deletions

View File

@ -1,3 +1,5 @@
* Replace all instances of foo.__proto__ by foo['__proto__'] for Caja-compliance. (Tobie Langel)
* Speed up Function#argumentNames. Avoid Enum dependency. (samleb, Tobie Langel)
* Fix Event#element accessing inexistent tagName property (e.g. when element is a document). (kangax)

View File

@ -1035,9 +1035,9 @@ Element.Methods.ByTag = { };
Object.extend(Element, Element.Methods);
if (!Prototype.BrowserFeatures.ElementExtensions &&
document.createElement('div').__proto__) {
document.createElement('div')['__proto__']) {
window.HTMLElement = { };
window.HTMLElement.prototype = document.createElement('div').__proto__;
window.HTMLElement.prototype = document.createElement('div')['__proto__'];
Prototype.BrowserFeatures.ElementExtensions = true;
}
@ -1148,7 +1148,7 @@ Element.addMethods = function(methods) {
if (window[klass]) return window[klass];
window[klass] = { };
window[klass].prototype = document.createElement(tagName).__proto__;
window[klass].prototype = document.createElement(tagName)['__proto__'];
return window[klass];
}

View File

@ -138,7 +138,7 @@ Event.extend = (function() {
};
} else {
Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__;
Event.prototype = Event.prototype || document.createEvent("HTMLEvents")['__proto__'];
Object.extend(Event.prototype, methods);
return Prototype.K;
}

6
src/prototype.js vendored
View File

@ -16,9 +16,9 @@ var Prototype = {
SelectorsAPI: !!document.querySelector,
ElementExtensions: !!window.HTMLElement,
SpecificElementExtensions:
document.createElement('div').__proto__ &&
document.createElement('div').__proto__ !==
document.createElement('form').__proto__
document.createElement('div')['__proto__'] &&
document.createElement('div')['__proto__'] !==
document.createElement('form')['__proto__']
},
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',