robfig / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

plovr changes the names in DOM dataset. #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use dataset in the DOM.
2. Compile with plovr advanced options.

What is the expected output? What do you see instead?

If there is something like domElt.dataset.DATANAME plovr replaces it with 
domElt.dataset.e or something similar. Everything after "dataset." must be kept 
as it is.

What version of the product are you using? On what operating system?
Latest version of plovr (plovr-81ed862.jar). Windows 7, updated of course.

Please provide any additional information below.

Original issue reported on code.google.com by lennart....@gmail.com on 27 Jan 2014 at 3:55

GoogleCodeExporter commented 9 years ago
Eh, sorry. This is a duplicate of 89 which I filed 2 weeks ago. I searched for 
"dataset", but I did not write that there... ;-)

Anyway, it might be more clear with both descriptions...

Original comment by lennart....@gmail.com on 27 Jan 2014 at 8:13

GoogleCodeExporter commented 9 years ago
this is working as designed. you need an externs file. 
https://developers.google.com/closure/compiler/docs/api-tutorial3

Original comment by Nicholas.J.Santos on 28 Jan 2014 at 3:30

GoogleCodeExporter commented 9 years ago
Thanks Nicholas. I have one (or rather several), but how do I handle 
*.dataset.* there? Can you please tell me the syntax for that?

Original comment by lennart....@gmail.com on 28 Jan 2014 at 3:52

GoogleCodeExporter commented 9 years ago
Maybe I found a working syntax, but I do not understand it. In the file

  closure/closure-compiler/externs/html5.js

there is a line

  HTMLElement.prototype.dataset;

I took that and added the DATANAME like this:

  HTMLElement.prototype.dataset.bg;

Seems like it works. (Or, I may have forgotten some test... ;-) )

Original comment by lennart....@gmail.com on 28 Jan 2014 at 4:15