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
Failsafe requirejs unset/reset #169
Conversation
Introduced in 5c75aa8 it might happen, that there is no `define` or `require` defined. handle this gracefully.
Hm ... one more problem of the new unset/reset scripts is, that |
@petschki - i just got this error with the plone.app.event 2.x javascript, which register itself as requirejs module, if it's available. I recommend to fix wildcard.foldercontents. |
@@ -1,4 +1,4 @@ | |||
var _old_define = define; |
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.
did you get an error here?
I wonder, because I'd have expected, if _old_define isn't defined, than define is just set to undefined.
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.
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.
Alright...
LGTM |
@petschki I'll come back to this later. But now, it's weekend! |
@thet you're right ... if they aren't define, they aren't reset. So the reset-script needs fallback: define = typeof(_old_define) !== 'undefined' ? _old_define : undefined;
require = typeof(_old_require) !== 'undefined' ? _old_require : undefined; this should do the trick ... |
the |
Introduced in 5c75aa8 it might happen,
that there is no
define
orrequire
defined. handle this gracefully.