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浏览器报语法错误 #497

Open
zjafei opened this issue Nov 30, 2017 · 5 comments
Labels

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)

没有

希望可以修复

@zzh-a
Copy link

zzh-a commented Dec 5, 2017

+1 我升级到 1.3.0 也遇到这个问题

@daihy8759
Copy link

我试了下把ansi-regex的箭头函数改掉,ie就可以了,希望尽快更新下

module.exports = function() {
	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');
};

@CrewS
Copy link

CrewS commented Dec 15, 2017

1.3.1好像也有这个问题

@sorrycc sorrycc added the bug label Dec 15, 2017
@662
Copy link

662 commented Dec 22, 2017

1.3.1也存在该问题 望修复 @sorrycc

@sqw2016
Copy link

sqw2016 commented Dec 22, 2017

箭头函数改完之后ie11好使,但ie9和ie10还是提示语法错误。
image
image

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

No branches or pull requests

7 participants