Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Forked from anonymous/gist:1294124
Created October 17, 2011 23:05
Show Gist options
  • Save TooTallNate/1294126 to your computer and use it in GitHub Desktop.
Save TooTallNate/1294126 to your computer and use it in GitHub Desktop.
Testing if "use strict" requires functions to always return something...
"use strict";
function test () {
console.log('hello?')
}
test()
@19h
Copy link

19h commented Oct 17, 2011

Yes, you're right. And it is not required. But I wanted to do it qua specificationem ;9
I'm using AcitveState Komodo IDE 7 Alpha with inbuilt syntax-check for Node and it notified me, that if it is run in a strict environment, it'd be against the rules. Quick check @ specification of ECMAScript and yes, there it was. All I wanted to do is stay safe by following the specification, who knows what V8 brings in time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment