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

Fix octals for strict mode #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alarner
Copy link

@alarner alarner commented Jun 23, 2016

When trying to use keypress in strict mode node complains because of use of octal literals. This PR changes octal literals to a format that works in strict mode.

node --use_strict test.js
/Users/alarner/oss/keypress/index.js:375
    key.y = s.charCodeAt(5) - 040;
                              ^^^

SyntaxError: Octal literals are not allowed in strict mode.
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/alarner/oss/keypress/test.js:2:16)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

@hellais
Copy link

hellais commented Jan 11, 2018

@TooTallNate do you think you could merge this PR and push a new package to npm? I think this is a good fix and it would be useful to have.

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.

3 participants