strong mode stripping?

9 views
Skip to first unread message

Michael McGlothlin

unread,
Oct 12, 2015, 12:56:40 PM10/12/15
to traceur-compiler-discuss
Is there an easy way to strip 'use strong'; lines or convert them to 'use strict'; or would this be something I'd need to add a transformation pass for?

John J Barton

unread,
Oct 12, 2015, 7:19:01 PM10/12/15
to traceur-comp...@googlegroups.com
Are you on the 'strong-mode' branch or 'master'? Can you post an example of your problem?

On Mon, Oct 12, 2015 at 9:56 AM, Michael McGlothlin <mike.mc...@gmail.com> wrote:
Is there an easy way to strip 'use strong'; lines or convert them to 'use strict'; or would this be something I'd need to add a transformation pass for?

--
You received this message because you are subscribed to the Google Groups "traceur-compiler-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to traceur-compiler-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael McGlothlin

unread,
Oct 13, 2015, 11:18:36 AM10/13/15
to traceur-comp...@googlegroups.com
The problem is mostly that with strong mode enabled the transpiled version fails if the system supports strong mode because it doesn't like the resulting var keywords. So I'm manually going in and removing that line right now but that keeps me from automating it without adding additional clean-up outside Traceur. Simply removing the line works for me but replacing it with 'use strict' is probably a better overall idea since strong is a subset of strict.

I tend to use a pattern similar to:

'use strict';
( function () {
 'use strong';

 let myVar = 42;
 ...

} ) .call( this );
Reply all
Reply to author
Forward
0 new messages