JSLint:意外的ES6功能 [英] JSLint: Unexpected ES6 feature

查看:148
本文介绍了JSLint:意外的ES6功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从jsllint.com上的在线linter收到了意外的ES6功能消息。

I got the message "Unexpected ES6 feature" from the online linter on jsllint.com.

违规行如下:

(t_1=(1+2));

但是暗示着什么意外的ES6功能?

But what unexpected ES6 feature is the hinting towards?

设置是

- Assume...   nodejs
- Tolerate... bitwise operators
- Tolerate... messy whitespace

,文件以开头use strict;

完整的程序:

"use strict";
var RUNTIME=(require("/Users/soegaard/Dropbox/GitHub/urlang/runtime.js"));
var cons=RUNTIME.cons;
var NULL=RUNTIME.NULL;
var str=RUNTIME.str;
function displayln(v){return (console.log(v));}
function closure_p(v){return ((Array.isArray(v))&&(v[0]==="CLOS"));}
var result=0;
((function(t_1){
   (t_1=(1+2));
   (result=(displayln(t_1)));
   return result;
  })(undefined));


推荐答案

将括号中包含的表达式视为箭头函数。

It is treating those expressions wrapped in parenthesis as arrow functions.

除此之外,这些代码使您的代码难以阅读。不需要它们,所以请放弃它们。

Aside, those make your code very hard to read. They aren't needed so please drop them.

这篇关于JSLint:意外的ES6功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆