Skip to content
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

Cannot capture continuation from JavaScript code not called directly by executeScriptWithContinuations or callFunctionWithContinuations #1444

Open
821938089 opened this issue Jan 28, 2024 · 0 comments

Comments

@821938089
Copy link

I've used executeScriptWithContinuations to call the js code, but it still throws this error.
In testing, I found that continuation cannot be captured in some cases.

function test1 () {
// call a function that capture continuation
}
test1() // success
test1.call() // success
test1.apply(this) // success
(function test1 () {
// call a function that capture continuation
})(); // success

test1.bind(this)() // fail
test1.bind(this).call() // fail

test2 = () => {
// call a function that capture continuation
}
test2() // fail
test2.call() // fail
(() => {
// call a function that capture continuation
})(); // fail


eval('// call a function that capture continuation') // fail

eval(`
function test1 () {
// call a function that capture continuation
}
test1()
`) // fail

eval(`
function test1 () {
// call a function that capture continuation
}
`)() // success

eval(`
function test1 () {
// call a function that capture continuation
}
`).call() // success

eval(`
function test1 () {
// call a function that capture continuation
}
`).apply(this) // success

eval(`
function test1 () {
// call a function that capture continuation
}
`).bind(this)() // fail

eval(`
function test1 () {
// call a function that capture continuation
}
`).bind(this).call() // fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant