Skip to content
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

Safari: "TypeError: Attempting to change the setter of an unconfigurable property." #3121

Closed
miztroh-zz opened this issue Dec 1, 2015 · 12 comments

Comments

@miztroh-zz
Copy link

JS Bin provided below. Confirmed working on Chrome, Firefox, IE11, and Edge. Safari errors out with the message above.

http://jsbin.com/hatuxapodu/edit?html,output

@dfreedm
Copy link
Member

dfreedm commented Dec 3, 2015

Wow, this is actually a Safari bug!

This also shows this issue, only in Safari: http://jsbin.com/miwukeyeto/edit?html,console

@dfreedm
Copy link
Member

dfreedm commented Dec 3, 2015

@kevinpschaaf and I found there are four problems here.

  1. the literal 0 in the binding is creating an accessor, element[0].
  2. In Safari, a for in loop over an object will repeat numeric keys if that object as a property set with Object.defineProperty
  3. The accessors polymer creates for data binding are non-configurable.
  4. In Safari, numeric keys will not honor getters and setters on the prototype for numeric keys
var proto = {};
Object.defineProperty(proto, '0', {
  get: function(){},
  set: function(){}
});
var o = Object.create(proto);
o[0] = 3;
// o[0] === undefined in Chrome, Firefox, and IE
// o[0] === 3 in Safari

The end result is that the accessor for the 0 literal is being defined twice on the model in Safari, which throws that the property is non-configurable.

@dfreedm
Copy link
Member

dfreedm commented Dec 3, 2015

Filed issue 4 above as https://bugs.webkit.org/show_bug.cgi?id=151812

@kevinpschaaf
Copy link
Member

Root cause issue that results in triggering the Safari bug with reduced repro here: #3128. Will likely just fix that to avoid the Safari bug here to resolve both.

@kevinpschaaf
Copy link
Member

Will be fixed in #3153.

JSBin repro using PR branch: http://jsbin.com/zapido/edit?html,output works on Safari now.

@miztroh-zz
Copy link
Author

@kevinpschaaf Your JSBin doesn't seem to work on El Capitan / Safari 9.0.2. Enable the console and you should see the same errors I'm getting.

@kevinpschaaf
Copy link
Member

Sorry, the branch I pointed to in that bin was merged to master and deleted, so I guess polygit defaults back to the last release when it can't find the branch.

Here's a new jsBin that points to master, showing it fixed: http://jsbin.com/yuturakaxi/1/edit?html,console,output

@miztroh-zz
Copy link
Author

@kevinpschaaf Ah, perfect. Any idea when we can expect this commit to make it into a release?

@miztroh-zz
Copy link
Author

@azakus Thanks for diagnosing this through the Polymer layer to base issue and reporting the bug to WebKit.

@kevinpschaaf
Copy link
Member

@miztroh It's possible we push a release today, if not next week.

@miztroh-zz
Copy link
Author

@kevinpschaaf There hasn't been a release since this was fixed in master. I've got several places across a website that are just broken in Safari. Can you give an update as to when we can expect a release?

@kevinpschaaf
Copy link
Member

We are doing pre-release tests now with the goal of getting one cut this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants