-
-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict ES5-shim(sham) 4.5.15 and ES6-shim(sham) 0.35.x #476
Comments
I'm afraid I'll need a lot more info than "does not work" :-) I use both es5-shim and es6-shim on a number of projects, so I'm also surprised to hear there's an issue. Here's the difference between v4.5.15 (which was released 3 months ago) and v4.5.14: v4.5.14...v4.5.15 The only differences that could possibly cause an issue are 64b444e (es5-sham, avoiding an infinite loop in pre-proto browsers) and 0fda3b8 (adding a name to the The only thing I can think of is that perhaps es6-shim is patching these Math methods, which affects some of the other things in es5-shim. |
The lines that are currently experiencing errors in es6-shim are as follows. https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L72 var defineProperty = function (object, name, value, force) {
if (!force && name in object) { return; }
if (supportsDescriptors) {
Object.defineProperty(object, name, {
configurable: true,
enumerable: false,
writable: true,
value: value
});
} else {
object[name] = value;
}
}; I checked the parameters passed. If
Based on the results above, there seems to be a problem with
|
Oh! Fixed! I fixed this change back to |
Thanks for clarifying; I’ll try to find a way to test this and avoid the infinite loop. |
@gnh1201 in which engines are you experiencing an error? is it when es6-shim is loaded, or when you invoke a specific method? |
The JavaScript engine uses Windows Scripting Host 5.812. There is a problem loading the library. |
Here is the file for the test. https://gist.github.com/gnh1201/3702353d163e549e097c2083b407f8fd |
This is an example of a project being used: https://github.com/gnh1201/welsonjs |
ah wow, WSH, that's a name i haven't heard in a long time :-) I don't have access to any windows machines, so I'm not sure how i can test this. What's the exact failure you get, and on what line (please include the entire stack trace if present), of that gist? |
The exact point of failure is that there is a variable called
if (proto || proto == null) { // `undefined` is for pre-proto browsers // <--- allow 'undefined' object
// if (proto || proto === null) // <--- disallow 'undefined' object
if (!force && name in object) { return; } // <--- error and break (because `object' is `undefined`) If I can see the stack trace, I will write it soon. |
What happens if you leave it as |
I modified it as below.
if (proto || proto == null) { // `undefined` is for pre-proto browsers
return proto || null; But the results were the same. |
I'm sorry. There is a difference when I check it again.
However, the variable |
If I change it as below, the error will be solved.
if (proto || typeof(proto) !== 'undefined') { // `undefined` is for pre-proto browsers
return proto; |
That change would disallow |
So what about |
The previous behavior for that branch was “truthy or null”, and the infinite loop bug fix was to change it to “truthy or null or undefined”. Every suggestion you’ve made reverts the bugfix by disallowing undefined there. |
Modifying es6-shim to match the changes in es5-shim(sham) corrected the error. Please check if it is a valid solution. |
The recently released version of
es5-shim
4.5.15 confirmed a conflict withes6-shim
0.35.x. It seems to be a new problem that did not occur in 4.5.14.I'm going to take a closer look at what the difference is soon.
The text was updated successfully, but these errors were encountered: