Page MenuHomePhabricator

Change JavaScript variables to constants.
Closed, DeclinedPublic

Description

Author: egon.wiki

Description:
Patch for fixing bug.

JavaScript variables generated by Skin::makeVariablesScript can be overwrited by user JavaScript code, or by Common.js (skinName.js).
This is bad because some ajax extensions might very depend on some of those variables. This apply essspecially to "skin" variable.


Version: 1.11.x
Severity: enhancement

Attached:

Details

Reference
bz10300

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:53 PM
bzimport set Reference to bz10300.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

As far as I can determine, "const" is not part of the ECMAScript standard and is not supported by non-Mozilla browsers. Is this incorrect?

(In reply to comment #1)

As far as I can determine, "const" is not part of the ECMAScript standard and
is not supported by non-Mozilla browsers. Is this incorrect?

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Constants

ayg wrote:

I'm aware that Mozilla browsers support const. Does IE? Does Opera? Do Safari, Konqueror, ...?

See the above link:

"const is a Mozilla-specific extension, it is not supported by IE or Opera."

This is a browser-specific implementation, marking WONTFIX.