Demo project that fails Google Closure Advanced Optimizations

64 views
Skip to first unread message

Robin Heggelund Hansen

unread,
Oct 20, 2016, 1:16:16 PM10/20/16
to Elm Discuss
I was wondering if anyone had a project that fails to run properly when applied with the Advanced Optimizations of the Google Closure Compiler?
I want to figure out what the problems are so that I can submit a PRs to fix the problem.
Pretty sure I've figured out what the problems are, but I need to replicate my success on larger projects than the few test cases I've made.

OvermindDL1

unread,
Oct 20, 2016, 3:42:55 PM10/20/16
to Elm Discuss
I know it fails on our large Elm project at work, we have to run with standard optimizations of the Google Closure compiler, but I did not research in to far since generated code is not code that I control and I needed to get things done.  If I get time I'll try to run it again and get some data on it.

Robin Heggelund Hansen

unread,
Oct 20, 2016, 4:21:31 PM10/20/16
to Elm Discuss
If you get the chance, try to change the generated code from the elm compiler and change statements that performs a `'ctor' in obj` tests. Change them to `typeof obj.ctor === 'undefined'` or some such. There is one in the eqHelp function (called by `=`) and one in the toString function.

The reason this will fail with google closure is that the ctor property is renamed when used with advanced optimizations, and so 'ctor' checks will fail.
Reply all
Reply to author
Forward
0 new messages