disable strict mode

1,911 views
Skip to first unread message

Wesley Smith

unread,
Jun 4, 2013, 5:26:10 PM6/4/13
to traceur-comp...@googlegroups.com
I have a class that uses a with() {} statement in a method, which I'd like to keep, but I'm getting errors due to strict mode being enabled.  How can I turn strict mode off?
thanks,
wes

Erik Arvidsson

unread,
Jun 7, 2013, 1:03:57 PM6/7/13
to traceur-comp...@googlegroups.com
Classes are strict in ES6.

What you need to do is to put your code that depends on the with statement into a function outside your class (and modules, modules are also strict) and call that from your class methods.

Out of curiosity: Why do you need with?

--
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/groups/opt_out.
 
 



--
erik


Wesley Smith

unread,
Jun 7, 2013, 1:29:23 PM6/7/13
to traceur-comp...@googlegroups.com
On Fri, Jun 7, 2013 at 10:03 AM, Erik Arvidsson <a...@chromium.org> wrote:
> Classes are strict in ES6.
>
> What you need to do is to put your code that depends on the with statement
> into a function outside your class (and modules, modules are also strict)
> and call that from your class methods.
>
> Out of curiosity: Why do you need with?
>

Thanks. It was mostly a point of curiosity. I was porting some code
from JS to ES6 that used a with statement. It's easy enough to fix
without disabling strict mode.
Reply all
Reply to author
Forward
0 new messages