-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ES5 bug related with constructor call without new
keyword
#866
Comments
At the very end of svg.js there is a One way is to add an UMD wrapper to ALL plugins (phew...). The other would be to wait for 3.0 to get released. Actually I would prefer the second one. What do you think? |
Ok, for my lib purposes I can use version from branch on forked version until the 3.0 version will be released |
3.0 is out. It should have your problem fixed, but if not; just continue the chat here :) I'll close for now |
When try to use svg.js in my lib with es5 modules and webpack@4.x + babel@6.2.x I found bug related with new ECMAscript 262 feature, I mean the one that says about calling constructor function without
new
keyword. Before, when you have been calling function withoutnew
,this
reference the global object (window in a browser), from now in this casethis
is set toundefined
to prevent accidental litteringwindow
object.Previous functionality has been used in
svg.js
file, hereMy suggest is a change from
this.SVG
towindow.SVG
because when module is wrapped intoumd.js
already gets preparedwindow
object from parent function.I can handle this today, in hour or two I'll create MR with proposed changes :)
The text was updated successfully, but these errors were encountered: