We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems Chrome 41 (possibly other older Chrome versions, or other browsers) do not allow Function.name redefinition via Object.defineProperty.
Function.name
Object.defineProperty
Offending line:
https://github.com/pzuraq/ember-decorators-polyfill/blob/master/vendor/ember-decorators-polyfill/index.js#L275
Minimal reproduction to drop in dev console on Chrome 41:
function a() {}; Object.defineProperty(a, 'name', { value: 'b' }); a.name;
As it says on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
Note that in non-standard, pre-ES2015 implementations the configurable attribute was false as well.
It seems it would make sense to wrap the Object.defineProperty for name in try catch, as ES2015+ browsers will allow to assign the name and others don't for this anonymous method: https://github.com/pzuraq/ember-decorators-polyfill/blame/master/vendor/ember-decorators-polyfill/index.js#L256
name
Or drop it all together.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It seems Chrome 41 (possibly other older Chrome versions, or other browsers) do not allow
Function.name
redefinition viaObject.defineProperty
.Offending line:
https://github.com/pzuraq/ember-decorators-polyfill/blob/master/vendor/ember-decorators-polyfill/index.js#L275
Minimal reproduction to drop in dev console on Chrome 41:
As it says on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
It seems it would make sense to wrap the
Object.defineProperty
forname
in try catch, as ES2015+ browsers will allow to assign the name and others don't for this anonymous method: https://github.com/pzuraq/ember-decorators-polyfill/blame/master/vendor/ember-decorators-polyfill/index.js#L256Or drop it all together.
The text was updated successfully, but these errors were encountered: