Backed out changeset ef8248e892e0 (bug 891110)
authorTim Taubert <ttaubert@mozilla.com>
Thu, 08 Aug 2013 05:24:03 +0200
changeset 141687 fd4cf30428b028bc9f5e568d7d68d3f9f3c4096b
parent 141686 ef8248e892e06500e0dea7a5003241eeac4d3855
child 141765 9252e17660dd7e24ae85fedcff2b520a011647f8
child 141810 728643fc9e3ca270538242952d66cfbeda882b23
child 155642 8e820dfb7ff301b9eead6dd2397cb89e99490eda
push id25069
push userttaubert@mozilla.com
push dateThu, 08 Aug 2013 06:26:34 +0000
treeherdermozilla-central@fd4cf30428b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs891110
milestone26.0a1
backs outef8248e892e06500e0dea7a5003241eeac4d3855
first release with
nightly linux32
fd4cf30428b0 / 26.0a1 / 20130808030205 / files
nightly linux64
fd4cf30428b0 / 26.0a1 / 20130808030205 / files
nightly mac
fd4cf30428b0 / 26.0a1 / 20130808030205 / files
nightly win32
fd4cf30428b0 / 26.0a1 / 20130808030205 / files
nightly win64
fd4cf30428b0 / 26.0a1 / 20130808030205 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset ef8248e892e0 (bug 891110)
toolkit/components/osfile/modules/osfile_shared_allthreads.jsm
toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js
--- a/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm
+++ b/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm
@@ -880,22 +880,17 @@ let declareFFI = function declareFFI(lib
       throw new TypeError("Missing implementation for argument " + (i - 3)
                           + " of symbol " + symbol
                           + " ( " + current.name + " )" );
     }
     signature.push(current.implementation);
   }
   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);
     };
     LOG("Function", symbol, "declared");
     return result;
   } catch (x) {
     // Note: Not being able to declare a function is normal.
     // Some functions are OS (or OS version)-specific.
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js
+++ b/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js
@@ -7,17 +7,16 @@ self.onmessage = function(msg) {
   log("received message "+JSON.stringify(msg.data));
   self.onmessage = function(msg) {
     log("ignored message "+JSON.stringify(msg.data));
   };
   test_init();
   test_getcwd();
   test_open_close();
   test_create_file();
-  test_passing_undefined();
   test_access();
   test_read_write();
   finish();
 };
 
 function test_init() {
   info("Starting test_init");
   importScripts("resource://gre/modules/osfile.jsm");
@@ -32,33 +31,16 @@ function test_open_close() {
   let result = OS.Unix.File.close(file);
   is(result, 0, "test_open_close: close succeeded");
 
   file = OS.Unix.File.open("/i do not exist", OS.Constants.libc.O_RDONLY, 0);
   is(file, -1, "test_open_close: opening of non-existing file failed");
   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");
   let file = OS.Unix.File.open("test.tmp", OS.Constants.libc.O_RDWR
                                | OS.Constants.libc.O_CREAT
                                | OS.Constants.libc.O_TRUNC,
                                OS.Constants.libc.S_IRWXU);
   isnot(file, -1, "test_create_file: file created");