fix(webdriverio): fix script execution#13470
Conversation
f2fee45 to
d30b0c5
Compare
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/appium-service
@wdio/browser-runner
@wdio/cli
@wdio/browserstack-service
@wdio/config
@wdio/concise-reporter
@wdio/dot-reporter
@wdio/cucumber-framework
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/lighthouse-service
@wdio/junit-reporter
@wdio/logger
@wdio/local-runner
@wdio/protocols
@wdio/mocha-framework
@wdio/reporter
@wdio/repl
@wdio/runner
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
webdriver
webdriverio
@wdio/sauce-service
commit: |
| 'var __name = (target, value) => __defProp(target, \'name\', { value, configurable: true });' + | ||
| 'globalThis.__name = __name;' | ||
| ) | ||
| return closure() |
There was a problem hiding this comment.
Are you sure this is all that's needed. See evanw/esbuild#607 (comment):
The
__namefunction is just one of many code transforms that esbuild can make that assume functions aren't arbitrarily recompiled by converting them to a string and feeding them toeval. Other examples include convertinga ** bto__pow(a, b)and{...a, ...b}to__assign({}, a), b).
There was a problem hiding this comment.
Are you aware of more polyfills that are needed here?
There was a problem hiding this comment.
Ruffle doesn't need any others for its tests currently but that doesn't means others won't or that future tests won't require others. I think any from this file might be needed:
https://github.com/evanw/esbuild/blob/main/internal/runtime/runtime.go
As stated in evanw/esbuild#607 (comment)
Preserving the value of
toString()on a function expression is not a design goal of esbuild. If that use case is important to you, it would be best to either arrange for the code to be passed as a string instead, or to use another tool that supports preserving the value oftoString()on a function.
There was a problem hiding this comment.
Understood. The amount of usecases for WDIO vs someone compiling a TS project with Esbuild is very different, e.g. no one would export variables from the test. My idea was to add more polyfills when needed as this seems the simplest approach while keeping the codebase as simple as possible.
e1a94a0 to
8ca843c
Compare
a6722dd to
f1941ee
Compare
|
@christian-bromann those changes fix #13444 without BiDi? I'm facing this issue now. |
|
@lararojasmr non bidi sessions have not been impacted by this issue. |
Proposed changes
fixes #13444
fixes #13443
In addition, this patch will:
given following script:
executeAsyncas there is not need for it anymoreTypes of changes
Checklist
Backport Request
//: # (The current
mainbranch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against thev8branch.)v9and doesn't need to be back-ported#XXXXXFurther comments
n/a
Reviewers: @webdriverio/project-committers