@@ -4113,6 +4113,17 @@ func TestArrowUseStrict(t *testing.T) {
}
+func TestParameterOverride(t *testing.T) {
+ const SCRIPT = `
+ function f(arg) {
+ var arg = arg || "default"
+ return arg
+ }
+ f()
+ `
+ testScript1(SCRIPT, asciiString("default"), t)
+}
+
/*
func TestBabel(t *testing.T) {
src, err := ioutil.ReadFile("babel7.js")
@@ -2326,7 +2326,7 @@ func (r *resolveMixedStack) exec(vm *vm) {
if r.idx > 0 {
idx = vm.sb + vm.args + r.idx
} else {
- idx = vm.sb + r.idx
+ idx = vm.sb - r.idx
ref = newStashRef(r.typ, r.name, (*[]Value)(&vm.stack), idx)