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

Can users set strict mode in JSX? #324

Open
yosuke-furukawa opened this issue Apr 30, 2014 · 5 comments
Open

Can users set strict mode in JSX? #324

yosuke-furukawa opened this issue Apr 30, 2014 · 5 comments

Comments

@yosuke-furukawa
Copy link

I published a JSX module implements Object.freeze in yesterday.

https://github.com/yosuke-furukawa/freezer.jsx

However, Object.freeze do not throw exception in non-strict mode.

I would like to know how to set 'use strict' in JSX.

@yosuke-furukawa
Copy link
Author

I have found a way to set strict mode in node.js.

--use_strict option is enabled in node.js runtime.
If this option enable, the program become strict mode inspite of "use strict"; or not.

@kazuho
Copy link
Member

kazuho commented May 1, 2014

Thank you for your contribution. Did the generated code run under strict mode?

IMO we should better always set use strict in the generated code, but I am not confident enough that it would not introduce any compatibility problem nor have any impact on execution speed.

@kazuho
Copy link
Member

kazuho commented May 14, 2014

FYI The code generated by JSX is not compatible with strict mode. You can see some tests failing in branch: https://github.com/jsx/JSX/tree/kazuho/experiments/use-strict

@nyuichi
Copy link
Member

nyuichi commented May 14, 2014

@kazuho

As tested your branch on my environment (v0.11.11), I don't see any warning or test failures. Which test case did you see failing?

@kazuho
Copy link
Member

kazuho commented May 15, 2014

@yosuke-furukawa @wasabiz

Sorry.

You need to run JSX_RUNJS='node --use_strict' make test on the aforementioned branch (kazuho/experiments/use-strict).

I have fixed subtle issues re compatibility with strict mode, but there are still problems.

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

No branches or pull requests

3 participants