Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-02-12 12:13:18 +0400
committerisaacs <i@izs.me>2013-02-20 02:14:38 +0400
commit7658f4c29c162819f72219bacf73aa840c1e59e4 (patch)
tree0ee9e6fa87562f35eb92f056132a7cd8740fc55d /benchmark
parent0e59efd079d6369cecd78719379cad2c3254e90d (diff)
bench: Fail gracefully if function_call binding fails
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/misc/function_call/index.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js
index ac05478a3e3..fc8542a068c 100644
--- a/benchmark/misc/function_call/index.js
+++ b/benchmark/misc/function_call/index.js
@@ -6,7 +6,16 @@
var assert = require('assert');
var common = require('../../common.js');
-var binding = require('./build/Release/binding');
+// this fails when we try to open with a different version of node,
+// which is quite common for benchmarks. so in that case, just
+// abort quietly.
+
+try {
+ var binding = require('./build/Release/binding');
+} catch (er) {
+ console.error('misc/function_call.js Binding failed to load');
+ process.exit(0);
+}
var cxx = binding.hello;
var c = 0;