Miss-compile: Uncaught SyntaxError: Unexpected token default

Description

This is a regression since 1.9.854.

This:

compiles to

Which results in Uncaught SyntaxError: Unexpected token default at runtime.

The compiler itself is also affected:
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc#L500

When removing all the requires in the test case, it compiles fine.

Attaching a test case.

Environment

None

Activity

Show:
Dieter Komendera
August 9, 2017, 3:18 PM

I was wrong in my initial assumption that this has anything to do with requiring stuff from the cljs* namespace, instead this happens with :language-out set to es5.

David Nolen
August 10, 2017, 12:07 PM

I don't really understand the provided patch. It could use a description (on the commit itself). It appears to revert the default changes and then only avoids munging if the var has a namespace?

António Monteiro
August 11, 2017, 4:50 PM

The patch has been updated with an inline comment detailing the proposed solution.

David Nolen
August 11, 2017, 8:16 PM

Assignee

António Monteiro

Reporter

Dieter Komendera

Labels

Approval

Vetted

Patch

Code

Priority

Major
Configure