Skip to content

Add exportTo() alias to avoid reserved word issues #18

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

Closed
wants to merge 1 commit into from
Closed

Add exportTo() alias to avoid reserved word issues #18

wants to merge 1 commit into from

Conversation

ypomortsev
Copy link
Contributor

export is a reserved word in JavaScript, so it is illegal to use it as
an identifier. Many linting tools will complain about a regular call to
export(module), requiring the following (ugly) fix:

To encourage good style while maintaining backwards compatibility,
the exportTo(module) alias can be used as a syntactically valid
replacement for export(module).

Closely related issue/fix in vows:

vowsjs/vows#27
vowsjs/vows@398443d

`export` is a reserved word in JavaScript, so it is illegal to use it as
an identifier. Many linting tools will complain about a regular call to
export(module), requiring the following (ugly) fix:

-    ).export(module);
+    )['export'](module);

To encourage good style while maintaining backwards compatibility,
the exportTo(module) alias can be used as a syntactically valid
replacement for export(module).

Closely related issue/fix in vows:

vowsjs/vows#27
vowsjs/vows@398443d
@indexzero
Copy link
Contributor

Thanks. Cherry-picked. Published in api-easy@0.3.2

@indexzero indexzero closed this Dec 8, 2011
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

Successfully merging this pull request may close these issues.

2 participants