Comments (6)
can you do 'if x === undefined) x = null'
from kataw.
the answer is no. let's imagine an obj:
{binding: undefined}
stringified to md => "{}"
parsed to {}
as deepEqual({binding: undefined}, {})
returns false, the case is always failing.
from kataw.
so where actually does this 'undefined' come from? Can you give me a test case that trigger this? It seems to be "BindingElement" in the parser, and a bug
from kataw.
from kataw.
Interesting. I can't find any undefined . This is the AST it output. No undefined to be found
{
"kind": 196,
"source": "'use strict'; var asyncArrow = async(...await) => {};",
"filename": "",
"scriptBody": {
"kind": 197,
"statements": [
{
"kind": 2097233,
"expression": {
"kind": 4261583,
"text": "use strict",
"rawText": "use strict",
"flags": 16777216,
"intersects": false,
"transformFlags": 0,
"start": 0,
"end": 12
},
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 0,
"end": 13
},
{
"kind": 2097397,
"declarationList": {
"kind": 244,
"declarations": [
{
"kind": 16627,
"binding": {
"kind": 131102,
"text": "asyncArrow",
"rawText": "asyncArrow",
"flags": 0,
"intersects": false,
"transformFlags": 1025,
"start": 17,
"end": 28
},
"exclamation": false,
"type": null,
"initializer": {
"kind": 81936,
"typeParameters": null,
"arrowParameters": {
"kind": 81929,
"elements": [
{
"kind": 16473,
"ellipsis": false,
"isOptional": false,
"type": null,
"initializer": null,
"decorators": null,
"accessModifier": null,
"isReadOnly": false,
"flags": 0,
"intersects": false,
"transformFlags": 1,
"start": 37,
"end": 46
}
],
"type": null,
"accessModifier": null,
"trailingComma": false,
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 40,
"end": 46
},
"contents": {
"kind": 91,
"functionStatementList": {
"kind": 94,
"statements": [],
"multiline": false,
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 51,
"end": 51
},
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 49,
"end": 52
},
"flags": 536870912,
"intersects": false,
"transformFlags": 0,
"start": 30,
"end": 52
},
"flags": 17,
"intersects": false,
"transformFlags": 0,
"start": 0,
"end": 52
}
],
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 17,
"end": 52
},
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 13,
"end": 53
}
],
"transformFlags": 0,
"flags": 0,
"intersects": false,
"start": 0,
"end": 53
},
"jsx": false,
"printable": true,
"diagnostics": [],
"incremental": false,
"flags": 0,
"intersects": false,
"transformFlags": 0,
"start": 0,
"end": 53
}
from kataw.
as I mentioned above, undefined
is not valid in JSON, so it will be ignored in the md file.
from kataw.
Related Issues (20)
- Implement CLI and kataw ignore comment HOT 24
- test runner - printed VALID code is INVALID HOT 19
- Add printer options in test runner HOT 1
- Add REPL HOT 1
- Implement printer options HOT 6
- implement pragma comments HOT 1
- The test runner goes crazy - 100 MB files HOT 6
- Test runner creates random 100 MB files HOT 6
- Test runner playing with backticks HOT 3
- test runner doesn't count to 100% HOT 1
- Implements linting and warnings HOT 3
- test runner - separate diagnostics HOT 8
- test runner - test fuzzer
- "re-design" and improve the reporters HOT 2
- 用 Kataw 替换 ESLint HOT 1
- JSON, YAML or JS ?? HOT 1
- Still in development? HOT 1
- Possible bug parsing destructured arrow function parameters HOT 1
- Possible bug regarding the use of IndexExpression vs. MemberAccessExpression
- Source maps HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kataw.