Skip to content
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

--mangle-props mangles the "pan" property of an AudioContext stereoPannerNode #2343

Closed
jameswilddev opened this issue Oct 1, 2017 · 7 comments · Fixed by #3369
Closed

--mangle-props mangles the "pan" property of an AudioContext stereoPannerNode #2343

jameswilddev opened this issue Oct 1, 2017 · 7 comments · Fixed by #3369

Comments

@jameswilddev
Copy link

Bug report or feature request?
Hello! I've found that the "pan" property of an AudioContext stereoPannerNode gets mangled by the --mangle-props argument.

ES5 or ES6+ input?
ES3

Uglify version (uglifyjs -V)
uglify-js 3.1.3

JavaScript input
var context = new AudioContext()
context.createStereoPanner().pan.linearRampToValueAtTime(1, context.currentTime + 3)

The uglifyjs CLI command executed or minify() options used.
'var context = new AudioContext(); context.createStereoPanner().pan.linearRampToValueAtTime(1, context.currentTime + 3)' | uglifyjs --compress --mangle --mangle-props

JavaScript output or error produced.
var context=new AudioContext;context.createStereoPanner().t.linearRampToValueAtTime(1,context.currentTime+3);

Thanks!

jameswilddev added a commit to SUNRUSE/SprigganTS that referenced this issue Oct 1, 2017
@kzc
Copy link
Contributor

kzc commented Oct 2, 2017

So just to be clear, you'd like the following change?

--- a/tools/domprops.json
+++ b/tools/domprops.json
@@ -4395,6 +4395,7 @@
     "paintRequests",
     "paintType",
     "palette",
+    "pan",
     "panningModel",
     "parent",
     "parentElement",

@alexlamsl Should the dom properties be updated with other recent browser changes?

@alexlamsl
Copy link
Collaborator

@kzc personally I wouldn't care if the whole Oxford Dictionary is loaded into tools/domprops.json 😏

Jokes aside, if anyone have a need for these changes please come up with a PR - a simple test case under test/compress/ should cover it nicely.

@kzc
Copy link
Contributor

kzc commented Oct 2, 2017

@alexlamsl What I meant was to open tools/props.html in the latest versions of the major browsers to see what new DOM props it comes up with. It would beat doing it manually/piecemeal.

@jameswilddev
Copy link
Author

jameswilddev commented Oct 2, 2017

Just taking a look at that tools/props.html file; I've got quite a few browsers here I can test it on:

  • IE8
  • IE9
  • IE10
  • IE11
  • EdgeHTML 15
  • Chrome 61.0.3163.100 (win64 and Android)
  • Firefox 56.0 (win64 and Android)
  • Windows Phone 7.8
  • Nintendo 2DS Browser
  • Safari (iOS 11.0.1)

However, due to the use of Object.getOwnPropertyNames and .foreach it doesn't run on many of these platforms. I'll see about making it ES3-safe.

@jameswilddev
Copy link
Author

Yeah that isn't as trivial as it looks from my armchair ivory tower :)

@alexlamsl
Copy link
Collaborator

for (var key in obj) { … } should be able to replace Object.getOwnPropertyNames() in this case.

Failing that, I'll have a poke at that HTML on IE8 this weekend.

@jameswilddev
Copy link
Author

You'd think so but there's complexities; for (var key in obj) doesn't work for arrays under IE8 for example. I might take another look at the weekend, I think I'm a bit drained tonight. Cheers for looking!

alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Apr 19, 2019
alexlamsl added a commit that referenced this issue Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants