-
Notifications
You must be signed in to change notification settings - Fork 181
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
Proxy is not able to parse code which contains spread fn(...args)
#1336
Comments
fn(...args)
fn(...args)
Unfortunately, I cannot reproduce your issue. fixture `Test`
.page('https://miherlosev.github.io/issue-pages/hammerhead/1336/index.html');
test('spread', async t => {
await t.click('body');
}); with TestCafe Could you provide a JavaScript code snippet that leads to the issue? |
thanks for quick check. yep, it seems that it works, but not sure whether script within html is parsed by your internal AST transpiler which wraps everything by hammerhead, so not sure whether you are running code which is failing. to be more specific, my page has couple of chunks, like <script src="a"/>
<script src="b"/>
<script src="c"/> if any of these scripts contain ... spread, then it does not work - script basically is not being loaded and error above is thrown. EDIT: if you won't be still able to reproduce this issue, will try to provide example over the weekend. |
I've changed a sample page as you described. P.S. If you can provide a public page on which this issue is reproduced it would be enough. |
We've encountered and consistently reproduced this issue in the particular case where we assign a member to a function:
Something like this: let object = {};
let propertyName = "arbitrary";
object[propertyName] = function (...restParameter) {
//Doesn't matter
} We've reproduced this issue in this repo, which references the GitHub.io page in this repo, and includes instructions for reproducing the issue. |
The problem related to var code = 'obj[prop] = function (...restParameter) {}';
var ast = acorn.parse(code);
var newCode = esotope.generate(ast); //throws an error
TypeError: ExprGen[$param.type] is not a function
at generateFunctionParams (lib\processing\script\tools\esotope.js:610:105)
at generateFunctionBody (lib\processing\script\tools\esotope.js:629:5)
at Object.generateFunctionExpression [as FunctionExpression] (lib\processing\script\tools\esotope.js:1205:9)
at Object.generateCallExpression [as CallExpression] (lib\processing\script\tools\esotope.js:1058:31) |
The fix is published in |
great, thanks guys for quick turnaround. |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
Hey!
I've encountered the issue when testcafe is not able to proxy page which contain scrips with not resolved spread operator, this is, if file will contain any expression like
fn(...sth)
then file is not being downloaded and browser hangs.Output from console is a bit cryptic and saying.
actually this error is handled but real reason it is caused by, (where $param.type = RestExpression)
I got two questions here:
The text was updated successfully, but these errors were encountered: