Backed out changeset ef8248e892e0 (bug 891110)

This commit is contained in:
Tim Taubert 2013-08-08 05:24:03 +02:00
Родитель fa3e1096d4
Коммит e7201e1a33
2 изменённых файлов: 1 добавлений и 24 удалений

Просмотреть файл

@ -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);
};

Просмотреть файл

@ -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");