Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Assume Object/Array prototypes are sealed #822
Excuse my ignorance (I really haven't investigated), what environments have sealed object and array prototypes?
Also the pull appears (at a cursery glance) to include other changes (e.g. https://github.com/cloudhead/less.js/pull/822/files#L2L900) or am I wrong?
On Mac OS X 10.7.4 (Lion) with Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720) and Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode), in the included Language ECMAScript 1.6 implemention "Mozilla Rhino" 1.6 release 2 the following is true.
typeof(undefined || null) == "undefined"
However, in most ECMAScript implementations that would be false. This causes some issues with less.js when a undefined value is passed through a "var || null" expression. So I replaced all || and && expressions that did not evaluate to a boolean.
Those changes you point out are in the artifact less-1.3.0.js, which was modified when I ran "make". It looks like the artifact was not update with the current parser.js. So this pull requests also bring the artifact update (not just with these changes, but also with the entire source code base). I am not sure what the policy is for artifacts, but I am happy to exclude them if desired.
Array/Object prototypes are not sealed in Rhino 1.6r2, so there's still a question of whether or not this PR is necessary for it's title purpose. I'd prefer not to get into the debate point that was brought up in #99 (extending natives), and I'm assuming @cloudhead didn't want to either since he closed it without comment.
Regarding the other changes (changing default operators to ternary operators), this should probably be done in a different PR, since once again it's not related to the ES5 changes. In addition, this was fixed in Rhino 1.6r3. Rhino 1.6r2 is nearing 7 years old, is it still widely used enough to warrant supporting it?
Dist files should definitely be excluded from any PR since merging a PR does not initiate a new version or build.