Skip to content

Commit f01260a

Browse files
committed
Address comments
1 parent 9cfeb61 commit f01260a

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

lib/native_loader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import childProcess from 'child_process';
1818
import { fileURLToPath } from 'url';
1919
import { createRequire } from 'module';
2020
import { NativeError } from './errors.js';
21-
import bindings from 'bindings';
2221
import createDebug from 'debug';
2322
import {
2423
detectPrebuildRuntime,
@@ -27,6 +26,9 @@ import {
2726
import { detectUbuntuCodename } from './utils.js';
2827

2928
const require = createRequire(import.meta.url);
29+
// 'bindings' is a CommonJS helper that relies on CJS caller context to locate
30+
// the compiled .node addon; load it via require() to preserve that context.
31+
const bindings = require('bindings');
3032
const __dirname = path.dirname(fileURLToPath(import.meta.url));
3133
const debug = createDebug('rclnodejs');
3234

lib/type_description_service.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ import loader from './interface_loader.js';
1616
import rclnodejs from './native_loader.js';
1717
import Service from './service.js';
1818

19-
import {
20-
ParameterType,
21-
Parameter,
22-
ParameterDescriptor,
23-
} from '../lib/parameter.js';
19+
import { ParameterType, Parameter, ParameterDescriptor } from './parameter.js';
2420

2521
// This class is used to create a TypeDescriptionService which can be used to
2622
// retrieve information about types used by the node’s publishers, subscribers,

0 commit comments

Comments
 (0)