Skip to content

Commit b458a63

Browse files
committed
js: Fix module loading on Windows
Fixes #642
1 parent e81ad1d commit b458a63

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

javascript/node/selenium-webdriver/CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v2.46.1
2+
3+
* Fixed internal module loading on Windows.
4+
15
## v2.46.0
26

37
* Exposed a new logging API via the `webdriver.logging` module. For usage, see

javascript/node/selenium-webdriver/_base.js

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ function Context(opt_configureForTesting) {
9898
CLOSURE_BASE_PATH: path.dirname(CLOSURE_BASE_FILE_PATH) + '/',
9999
CLOSURE_IMPORT_SCRIPT: function(src, opt_srcText) {
100100
if (opt_srcText !== undefined) {
101+
// Windows paths use backslashes, which must be properly escaped before
102+
// evaluated with vm.runInContext.
103+
opt_srcText = opt_srcText.replace(/\\/g, '/');
101104
vm.runInContext(opt_srcText, closure, src);
102105
} else {
103106
loadScript(src);

javascript/node/selenium-webdriver/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-webdriver",
3-
"version": "2.46.0",
3+
"version": "2.46.1",
44
"description": "The official WebDriver JavaScript bindings from the Selenium project",
55
"keywords": [
66
"automation",

0 commit comments

Comments
 (0)