提交 880a87b3 编写于 作者: R Ricardo Cabello

Merge pull request #6771 from dubejf/ie-polyfill

Polyfill for es6 Function.Name
......@@ -26,6 +26,23 @@ if ( Math.sign === undefined ) {
}
if ( Function.prototype.name === undefined && Object.defineProperty !== undefined ) {
// Missing in IE9-11.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
Object.defineProperty( Function.prototype, 'name', {
get: function() {
var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
return name;
}
});
}
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册