question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on strict mode

See original GitHub issue

I got this error with the code expect(value).to.be.null that run on strict mode. chai-error-strict-mode

P/s. I’m using chai@3.4.1 installed via npm install chai.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

5reactions
ghostcommented, Apr 4, 2016

Hey @lucasfcosta, I’m not sure I understand this. What is exactly the final decision then? I think the arguments.callee still should be replaced with:

flag(this, 'ssfi', stack || Assertion)

The only thing I wouldn’t include is the 'use strict'; part on the top of every file. This way no bugs would be introduced, everything would still work as expected and lazy people like me could use --use_strict without any error message.

2reactions
ghostcommented, Apr 4, 2016

I checked a few things and I think it might be best if the 'use strict'; were not included. http://stackoverflow.com/questions/16871050/inconsistent-scope-of-use-strict-on-different-web-browsers-concerning-argumen The linked jsfiddle fails in Firefox, so if somebody extends chai in some weird way it could cause problems for them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strict mode - JavaScript - MDN Web Docs
Strict mode changes some previously-accepted mistakes into errors. JavaScript was designed to be easy for novice developers, and sometimes it ...
Read more >
JavaScript "use strict" - W3Schools
As an example, in normal JavaScript, mistyping a variable name creates a new global variable. In strict mode, this will throw an error,...
Read more >
Solve JavaScript Error before it happens [strict mode] - Atatus
Strict Mode prevents certain actions from being taken and thrown out as errors. It protects you from the most common and egregious aspects ......
Read more >
'with' is not allowed in strict mode - JSLint Error Explanations
This error is raised to highlight a fatal JavaScript syntax error. Your code will fail to run in any environment that supports strict...
Read more >
Strict mode in JavaScript - GeeksforGeeks
Strict mode eliminates some JavaScript silent errors by changing them to throw errors. Strict mode fixes mistakes that make it difficult for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found