mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
src: update module version mismatch error message
Fixes: https://github.com/nodejs/node/issues/8379 PR-URL: https://github.com/nodejs/node/pull/8391 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
1 parent
96b501d338
commit
1fda657cac
4 files changed
+42
-2
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#include <node_version.h>
|
||||
#undef NODE_MODULE_VERSION
|
||||
#define NODE_MODULE_VERSION 42
|
||||
#include <node.h>
|
||||
|
||||
namespace {
|
||||
|
||||
inline void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Value> module,
|
||||
v8::Local<v8::Context> context) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NODE_MODULE_CONTEXT_AWARE(binding, Initialize)
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'binding',
|
||||
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
|
||||
'sources': [ 'binding.cc' ]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
require('../../common');
|
||||
const assert = require('assert');
|
||||
|
||||
const re = new RegExp(
|
||||
'was compiled against a different Node.js version using\n' +
|
||||
'NODE_MODULE_VERSION 42. This version of Node.js requires\n' +
|
||||
`NODE_MODULE_VERSION ${process.versions.modules}.`);
|
||||
|
||||
assert.throws(() => require('./build/Release/binding'), re);
|
||||
Reference in new issue
Block a user