简体   繁体   English

充满语法错误的 Atom 源

[英]Atom source full of syntax errors

Recently wanted to look in to atom editor, but, when looking at the source, i see that there are plenty of errors in .js files like syntax errors.最近想看看 atom 编辑器,但是,在查看源代码时,我发现 .js 文件中有很多错误,例如语法错误。

Could someone shine some light on me, why popular project has so many syntax errors (or am i missing something?)?有人能给我一些启发吗,为什么流行的项目有这么多语法错误(或者我错过了什么?)?

By syntax errors, this is what i mean (missing semicolons & even code, that is not javascript valid code.):通过语法错误,这就是我的意思(缺少分号和偶数代码,这不是 javascript 有效代码。):

在此处输入图片说明 在此处输入图片说明

Semicolons are not strictly required for most JavaScript to run.大多数 JavaScript 的运行并不严格要求分号。

The code you posted contains ES2015 syntax, which is perfectly valid JavaScript.您发布的代码包含 ES2015 语法,这是完全有效的 JavaScript。

What you see there is indeed valid syntax.你看到的确实是有效的语法。

Semicolons can (mostly) be omitted in JavaScript and are optional.分号可以(大部分)在 JavaScript 中省略并且是可选的。 It is a question of convention whether you use them or not.无论您是否使用它们,这是一个约定问题。

The syntax you can see in the screenshot is valid ES2015 syntax .您可以在屏幕截图中看到的语法是有效的 ES2015 语法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM