From 7658f4c29c162819f72219bacf73aa840c1e59e4 Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 12 Feb 2013 00:13:18 -0800 Subject: [PATCH] bench: Fail gracefully if function_call binding fails --- benchmark/misc/function_call/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js index ac05478a3e..fc8542a068 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;