-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[addon-actions] Check result of getPropertyDescriptor for IE11 #2428
[addon-actions] Check result of getPropertyDescriptor for IE11 #2428
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2428 +/- ##
==========================================
+ Coverage 16.64% 16.65% +0.01%
==========================================
Files 302 302
Lines 7769 7770 +1
Branches 786 776 -10
==========================================
+ Hits 1293 1294 +1
- Misses 5821 5879 +58
+ Partials 655 597 -58
Continue to review full report at Codecov.
|
addons/actions/src/preview.js
Outdated
// This condition is true in modern browsers that implement Function#name properly | ||
const canConfigureName = Object.getOwnPropertyDescriptor(handler, 'name').configurable; | ||
const canConfigureName = nameDescriptor && nameDescriptor.configurable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also try !nameDescriptor || nameDescriptor.configurable
. As far as I remember, IE11 had no problems with overriding function name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I tested this suggestion in IE11 and it worked. Pushed a new commit, please have a look.
3.2.18 includes a fix for a bug that broke storybook in IE11: storybookjs/storybook#2428
3.2.18 includes a fix for a bug that broke storybook in IE11: storybookjs/storybook#2428
3.2.18 includes a fix for a bug that broke storybook in IE11: storybookjs/storybook#2428
Issue: When using
action-addons
in IE11, it would throw "Unable to get property 'configurable' of undefined or null reference" because apparently IE returnsundefined
fromObject.getPropertyDescriptor
when called on a function.What I did
Check result of
Object.getPropertyDescriptor
before checking.configurable
.How to test
Load storybook that uses
actions
in IE11 and verify that the iframe loads.Is this testable with jest or storyshots? No, this is IE-specific behaviour.
Does this need a new example in the kitchen sink apps? No
Does this need an update to the documentation? No