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

dart2js : --minify precompiled.js yields 'Uncaught SyntaxError: Unexpected token function` #13613

Closed
DartBot opened this issue Sep 26, 2013 · 9 comments
Assignees
Milestone

Comments

@DartBot
Copy link

DartBot commented Sep 26, 2013

This issue was originally filed by ross.dart...@gmail.com


r27936
Windows 7x64

Any *.dart which I attempt to use as dart.precompiled.js with --minify specified is failing at runtime with:

Uncaught SyntaxError: Unexpected token function

The javascript looks like the following in all cases:

.....
Isolate.prototype.constructor=Isolate
Isolate.p=y
Isolate.$finishClasses=a.$finishClasses
Isolate.makeConstantList=a.makeConstantList
return Isolate}}
})()function dart_precompiled(a){var z // THIS IS THE LINE
function FK(b){this.tT=b}FK.builtin$cls="FK"
.....

The dart.precompiled.js works without --minify

thanks,

@kasperl
Copy link

kasperl commented Sep 26, 2013

Set owner to @peter-ahe-google.
Added this to the M7 milestone.
Removed Priority-Unassigned label.
Added Priority-Medium, Area-Dart2JS, Triaged labels.

@peter-ahe-google
Copy link
Contributor

Ouch, we're not testing minified CSP code. I filed issue #13614 about that.

@peter-ahe-google
Copy link
Contributor

@DartBot
Copy link
Author

DartBot commented Sep 26, 2013

This comment was originally written by ross.dart...@gmail.com


Thanks for the quick response Peter.

I updated to r27941 and now the most trivial --minify CSP window works (an empty one); but as soon as I add any content such as the following:

import 'dart:html';
main() {
  document.body.append(new SpanElement()..text = 'snarf');
}

I get a new error:

Uncaught TypeError: Cannot set property 'gEk' of undefined

thanks,

@peter-ahe-google
Copy link
Contributor

Thank you, Ross. I'll try to fix it ASAP.

@peter-ahe-google
Copy link
Contributor

@peter-ahe-google
Copy link
Contributor

Fixed in r27954.


Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Sep 26, 2013

This comment was originally written by ross.dart.l...@gmail.com


Thanks Peter!

Looks good, my app compiles --minify CSP and runs in Canary w/ r27954 (w/ workarounds for other known issues in place)

@peter-ahe-google
Copy link
Contributor

Hi Ross, Thank you for letting us know!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants