fix assignment to readonly property to allow running in strict mode#270
fix assignment to readonly property to allow running in strict mode#270broofa merged 3 commits intouuidjs:masterfrom G-Rath:assign-name-using-Object.defineProperty
Conversation
…rty, as you can't assign to readonly properties in strict mode.
|
@broofa for some reason the Since I don't know how that file works, I've not committed the changes. Let me know if I should. |
…ing to configure it. This should allow compatibility with both strict mode and non-standard, pre-ES2015 implementations, such as in node 0.12.x
|
@broofa it seems this solution won't work with node 0.12.x, as it's a non-standard, pre-ES2015 implementation. I've fixed this by adding a conditional check to make sure the Given that prior to this the assignment to Let me know what you think, and if there are any adjustments you'd like me to make :) |
|
I published https://www.npmjs.com/package/uuid-pull-270 on NPM based on @G-Rath branch in case someone need it as well 😄 |
|
Hello @broofa, any news on when this will get published? Struggling to get node-uuid working without this patch. |
…270) * Replaced assignment to readonly Function.name with Object.defineProperty, as you can't assign to readonly properties in strict mode. * added check to make sure the name property is configurable before trying to configure it. This should allow compatibility with both strict mode and non-standard, pre-ES2015 implementations, such as in node 0.12.x * Removed extra blank newline.
…270) * Replaced assignment to readonly Function.name with Object.defineProperty, as you can't assign to readonly properties in strict mode. * added check to make sure the name property is configurable before trying to configure it. This should allow compatibility with both strict mode and non-standard, pre-ES2015 implementations, such as in node 0.12.x * Removed extra blank newline.
Replaced assignment to readonly Function.name with Object.defineProperty, as you can't assign to readonly properties in strict mode.
Fixes #268