RobotWebTools / roslibjs

The Standard ROS JavaScript Library
https://robotwebtools.github.io/roslibjs
Other
659 stars 372 forks source link

global -> globalThis #689

Closed EzraBrooks closed 4 months ago

EzraBrooks commented 4 months ago

Public API Changes

Fixes a bug I introduced with usage of the global ROSLIB object.

Description

global doesn't exist in browsers but does in Node.js. window doesn't exist in Node.js but does exist in browsers. globalThis exists in both, acting as a proxy to the appropriate one.

Fixes a bug where importing roslib class-by-class works fine but importing the whole library in a browser application throws a ReferenceError.