Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing if "use strict" requires functions to always return something...
"use strict";
function test () {
console.log('hello?')
}
test()
@19h

This comment has been minimized.

Copy link

@19h 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
You can’t perform that action at this time.