1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Always declare a function if an identifier is given

This commit is contained in:
Robert Krimen
2013-04-27 22:29:03 +02:00
parent cfd5635e46
commit dfa7a59c6f
2 changed files with 20 additions and 2 deletions

View File

@@ -215,6 +215,20 @@ func TestFunction(t *testing.T) {
};
delete xyz;
`, "false")
if true {
// TODO
test(`
var abc = function __factorial(def){
if (def === 1) {
return def;
} else {
return __factorial(def-1)*def;
}
};
abc(3);
`, "6")
}
}
func TestIf(t *testing.T) {