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

Error in Strict Mode #47

Closed
wants to merge 1 commit into from
Closed

Error in Strict Mode #47

wants to merge 1 commit into from

Conversation

winton
Copy link

@winton winton commented Sep 25, 2013

When executing in strict mode (coffeescript default), I got this error:

undefined:1
(function(){return function static(req, res, next){return agent.tracer.callbac
                   ^^^^^^^^^^^^^^^
SyntaxError: Use of future reserved word in strict mode
    at wrapHandle (/Users/wintonwelsh/Sites/gitcycle_api/node_modules/newrelic/lib/instrumentation/connect.js:72:70)
    at HTTPServer.<anonymous> (/Users/wintonwelsh/Sites/gitcycle_api/node_modules/newrelic/lib/instrumentation/connect.js:94:26)
    at HTTPServer.app.use (/Users/wintonwelsh/Sites/gitcycle_api/node_modules/express/lib/http.js:231:36)
    at HTTPServer.<anonymous> (/Users/wintonwelsh/Sites/gitcycle_api/lib/app.js:163:7)
    at HTTPServer.app.configure (/Users/wintonwelsh/Sites/gitcycle_api/node_modules/express/lib/http.js:543:61)
    at Object.<anonymous> (/Users/wintonwelsh/Sites/gitcycle_api/lib/app.js:162:5)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

@othiym23
Copy link
Contributor

If you read the comment above that function, you'll see that setting the name of the wrapper function to be identical to the wrapped function is the reason that eval statement exists. static is a name that comes from Express / Connect (how does using the middleware not trip strict mode's alarms?), so file an issue with their maintainers.

Thanks for the report, but we can't accept this patch.

@othiym23 othiym23 closed this Sep 25, 2013
cmcadams-newrelic pushed a commit to cmcadams-newrelic/node-newrelic that referenced this pull request Jan 29, 2024
…-map-example

Example of source map support
jsumners-nr pushed a commit to jsumners-nr/node-newrelic that referenced this pull request Apr 11, 2024
jsumners-nr pushed a commit to jsumners-nr/node-newrelic that referenced this pull request Apr 16, 2024
bizob2828 referenced this pull request in bizob2828/node-newrelic Jul 26, 2024
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