Skip to content
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

roadhog 1.2.2 在开发环境下js文件中有非业务代码的箭头函数导致IE浏览器报语法错误 #1369

Closed
zjafei opened this issue Nov 30, 2017 · 2 comments

Comments

@zjafei
Copy link

zjafei commented Nov 30, 2017

Environment(required) | 环境(必填)

  • roadhog version(roadhog版本)1.2.2
  • Nodejs and Npm version(Nodejs 和 Npm 版本)6.11.2
  • Operating environment (e.g. OS name) and its version(操作系统版本): Windows7

What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)

通过 dva-cli 创建项目
cnpm start

What do you expected?(预期的正常效果)

IE11可以正常运行

What happen?(发生了何种非正常现象)

IE11 提示语法错误
错误代码定位是

module.exports = () => {
	const pattern = [
		'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
		'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
	].join('|');
	
	return new RegExp(pattern, 'g');
};

但是换为 roadhog 0.6.0 同样的文件
就可以在 IE9IE11 中运行
应该是箭头函数的问题
这个箭头函数是整个js文件里面唯一的箭头函数
而且不是业务代码里面的
这个问题只会出现在开发环境
编译出来的js是没有这样的问题的

Re-producible online demo (可复现的在线demo)

没有

希望可以修复

@yaolongqing
Copy link

我也遇到该问题,搞好长时间了,仍没有解决

@sorrycc sorrycc closed this as completed Apr 18, 2018
@sorrycc
Copy link
Member

sorrycc commented Apr 18, 2018

参考 sorrycc/blog#68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants