Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

crypto: remove hoisted function #9316

Closed
wants to merge 1 commit into from
Closed

crypto: remove hoisted function #9316

wants to merge 1 commit into from

Conversation

vkarpov15
Copy link

Heya,

Re: Automattic/mongoose#2281, crypto and strict mode don't play nicely together:

$ node -v
v0.12.0
$ node --use_strict
> var c = require('crypto');
crypto.js:604
    function next(er, ret) {
    ^^^^^^^^
SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function.
    at runInThisContext (node.js:741:18)
    at NativeModule.compile (node.js:804:14)
    at Function.NativeModule.require (node.js:774:18)
    at Function.Module._load (module.js:295:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at repl:1:9
    at REPLServer.defaultEval (repl.js:132:27)
    at bound (domain.js:254:14)
    at REPLServer.runBound [as eval] (domain.js:267:12)
> 
(^C again to quit)
> 

This'll fix that particular issue

@cjihrig
Copy link

cjihrig commented Mar 2, 2015

Thanks for reporting this. This was recently fixed in #9237

@cjihrig cjihrig closed this Mar 2, 2015
@vkarpov15
Copy link
Author

Thanks for fixing, much appreciated. Will this get backported to 0.10?

@misterdjules
Copy link

@vkarpov15 As far as I know, this issue doesn't affect node v0.10.x. Did you encounter a similar problem with node v0.10.x?

@vkarpov15
Copy link
Author

Nope, I just didn't check 0.10. No further issues, thanks for your help.

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

Successfully merging this pull request may close these issues.

4 participants