babel/minify

problem with try catch on ie8

オープン

#604 opened on 2017/06/26

 (0 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (223 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (4,377 個のスター)
PR merge metrics
 (PR metrics pending)

説明

environment

nodejs@8.1.1
babel-core@6.25.0
babel-preset-babili@0.1.4
babel-preset-env@1.5.2

test.js

var babel = require('babel-core');
var env = require('babel-preset-env');
var babili = require('babel-preset-babili');
var t = babel.transformFileSync('code.js', {
	presets: [[env,{"targets":{"browsers":"ie >= 7"}}],babili],
	babelrc: false
});
console.log(t.code);

code.js

function a(b){
	try{
		console.log(123);
	} catch(e){}
	b();
}
a(function(){
	console.log(456);
});

command line

node test.js

output

"use strict";function a(a){try{console.log(123)}catch(a){}a()}a(function(){console.log(456)});

the output code does not work in ie8

コントリビューターガイド