Backed out changeset ef8248e892e0 (bug 891110)

This commit is contained in:
Tim Taubert 2013-08-08 05:24:03 +02:00
parent 5d289c086b
commit 5a866dae32
2 changed files with 1 additions and 24 deletions

View File

@ -885,12 +885,7 @@ let declareFFI = function declareFFI(lib, symbol, abi,
}
try {
let fun = lib.declare.apply(lib, signature);
let result = function ffi(...args) {
for (let i = 0; i < args.length; i++) {
if (typeof args[i] == "undefined") {
throw new TypeError("Argument " + i + " of " + symbol + " is undefined");
}
}
let result = function ffi(/*arguments*/) {
let result = fun.apply(fun, arguments);
return returnType.importFromC(result, symbol);
};

View File

@ -12,7 +12,6 @@ self.onmessage = function(msg) {
test_getcwd();
test_open_close();
test_create_file();
test_passing_undefined();
test_access();
test_read_write();
finish();
@ -37,23 +36,6 @@ function test_open_close() {
is(ctypes.errno, OS.Constants.libc.ENOENT, "test_open_close: error is ENOENT");
}
function test_passing_undefined()
{
info("Testing that an exception gets thrown when an FFI function is passed undefined");
let exceptionRaised = false;
try {
let file = OS.Unix.File.open(undefined, OS.Constants.libc.O_RDWR
| OS.Constants.libc.O_CREAT
| OS.Constants.libc.O_TRUNC,
OS.Constants.libc.S_IRWXU);
} catch(e if e instanceof TypeError) {
exceptionRaised = true;
}
ok(exceptionRaised, "test_passing_undefined: exception gets thrown")
}
function test_create_file()
{
info("Starting test_create_file");