-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webdriverio): Upgrade to axe-core@4.3.3 #331
Conversation
packages/webdriverio/src/index.ts
Outdated
@@ -1,18 +1,23 @@ | |||
import type { RunOptions, AxeResults } from 'axe-core'; | |||
import { source } from 'axe-core'; | |||
import { source, ContextObject } from 'axe-core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't use axe.source. JavaScript no longer guarantees Function.prototype.toString()
returning the complete source. Should use fs.readFileSync
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JavaScript no longer guarantees Function.prototype.toString() returning the complete source.
Can you provide your source for this information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://tc39.es/Function-prototype-toString-revision/#proposal-sec-function.prototype.tostring:
If func is a Bound Function exotic object or a built-in Function object, then return an implementation-dependent String source code representation of func. The representation must have the syntax of a NativeFunction. Additionally, if func is a Well-known Intrinsic Object and is not identified as an anonymous function, the portion of the returned String that would be matched by PropertyName must be the initial value of the name property of func.
If I'm reading this correctly, Function#toString()
is fine for our use case.
Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com>
Blocked by: #333