Skip to content

Can users set strict mode in JSX? #324

Open

Description

@yosuke-furukawa

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.

Activity

  1. yosuke-furukawa commented on Apr 30, 2014

    @yosuke-furukawa
    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.

  2. kazuho commented on May 1, 2014

    @kazuho
    Member

    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.

  3. kazuho commented on May 14, 2014

    @kazuho
    Member

    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

  4. nyuichi commented on May 14, 2014

    @nyuichi
    Member

    @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?

  5. kazuho commented on May 15, 2014

    @kazuho
    Member

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy