| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 var argsStr = args.join(", "); | 56 var argsStr = args.join(", "); |
| 57 return new Function(args.join(", "), "return %" + name + "(" + argsStr + ");")
; | 57 return new Function(args.join(", "), "return %" + name + "(" + argsStr + ");")
; |
| 58 } | 58 } |
| 59 | 59 |
| 60 function testArgumentCount(name, argc) { | 60 function testArgumentCount(name, argc) { |
| 61 for (var i = 0; i < 10; i++) { | 61 for (var i = 0; i < 10; i++) { |
| 62 var func = null; | 62 var func = null; |
| 63 try { | 63 try { |
| 64 func = makeFunction(name, i); | 64 func = makeFunction(name, i); |
| 65 } catch (e) { | 65 } catch (e) { |
| 66 if (e != "SyntaxError: illegal access") throw e; | 66 if (e != "SyntaxError: Illegal access") throw e; |
| 67 } | 67 } |
| 68 if (func === null && i == argc) { | 68 if (func === null && i == argc) { |
| 69 throw "unexpected exception"; | 69 throw "unexpected exception"; |
| 70 } | 70 } |
| 71 var args = [ ]; | 71 var args = [ ]; |
| 72 for (var j = 0; j < i; j++) | 72 for (var j = 0; j < i; j++) |
| 73 args.push(0); | 73 args.push(0); |
| 74 try { | 74 try { |
| 75 func.apply(void 0, args); | 75 func.apply(void 0, args); |
| 76 } catch (e) { | 76 } catch (e) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 if (name in knownProblems || name in currentlyUncallable) | 189 if (name in knownProblems || name in currentlyUncallable) |
| 190 continue; | 190 continue; |
| 191 print(name); | 191 print(name); |
| 192 var argc = nativeInfo[1]; | 192 var argc = nativeInfo[1]; |
| 193 testArgumentCount(name, argc); | 193 testArgumentCount(name, argc); |
| 194 testArgumentTypes(name, argc); | 194 testArgumentTypes(name, argc); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 testNatives(); | 198 testNatives(); |
| OLD | NEW |