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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user