Index: test/mjsunit/fuzz-natives.js |
=================================================================== |
--- test/mjsunit/fuzz-natives.js (revision 4085) |
+++ test/mjsunit/fuzz-natives.js (working copy) |
@@ -57,9 +57,17 @@ |
return new Function(args.join(", "), "return %" + name + "(" + argsStr + ");"); |
} |
-function testArgumentCount(name) { |
+function testArgumentCount(name, argc) { |
for (var i = 0; i < 10; i++) { |
- var func = makeFunction(name, i); |
+ var func = null; |
+ try { |
+ func = makeFunction(name, i); |
+ } catch (e) { |
+ if (e != "SyntaxError: illegal access") throw e; |
+ } |
+ if (func === null && i == argc) { |
+ throw "unexpected exception"; |
+ } |
var args = [ ]; |
for (var j = 0; j < i; j++) |
args.push(0); |
@@ -176,7 +184,7 @@ |
continue; |
print(name); |
var argc = nativeInfo[1]; |
- testArgumentCount(name); |
+ testArgumentCount(name, argc); |
testArgumentTypes(name, argc); |
} |
} |