Use Strict Directive needs to be preflighted
See original GitHub issueFound this issue while cleaning up test262 file, not sure if this is possible in meriyah. It’s not a serious bug in real world, as people always put use strict directive at beginning of a scope.
Meriyah rejects following code as per spec:
> parse('"use strict"; "\\1";')
Uncaught:
[ParseError [SyntaxError]: [1:16]: Octal escape sequences are not allowed in strict mode
] {
index: 16,
line: 1,
column: 16,
description: '[1:16]: Octal escape sequences are not allowed in strict mode',
loc: { line: 1, column: 16 }
}
But failed to do so if the use strict directive is after the problematic code.
> parse('"\\1"; "use strict";')
{
type: 'Program',
sourceType: 'script',
body: [
{ type: 'ExpressionStatement', expression: [Object] },
{ type: 'ExpressionStatement', expression: [Object] }
]
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Cross-Origin Resource Sharing (CORS) - MDN Web Docs
Unlike simple requests, for "preflighted" requests the browser first sends an HTTP request using the OPTIONS method to the resource on the other ......
Read more >Configuring CORS - Apollo GraphQL Docs
If you use graphql-upload you should keep the CSRF prevention feature enabled, and configure your upload clients to send a non-empty Apollo-Require-Preflight ......
Read more >CORS FAQ - cors-errors.info
A preflight request is just an HTTP request, so it can be sent using Postman. To send the request manually you'll need to...
Read more >No 'Access-Control-Allow-Origin' - Node / Apache Port Issue
The request origin needs to match the allowed origin(s), and you can also have multiple of them: app.use( cors({origin: ...
Read more >CSRF, CORS, and HTTP Security headers Demystified
CSRF protection support needs to be added to your application code and cannot ... Note that CORS preflight requests are not made for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am not going to try, at least for now. This bug has no impact on real world code. It’s just an edge case in the spec. People has no reason to write code like this, rather than testing a parser’s spec compliance.
I will try to decipher ecma spec first. That adjacency is weird.