Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度多边形填充问题:IE11-core js v3.6.5方法es.string.split.js无法在拆分时解析regex/^ |\s+/_Angular_Internet Explorer 11_Polyfills_Core Js - Fatal编程技术网

Angular 角度多边形填充问题:IE11-core js v3.6.5方法es.string.split.js无法在拆分时解析regex/^ |\s+/

Angular 角度多边形填充问题:IE11-core js v3.6.5方法es.string.split.js无法在拆分时解析regex/^ |\s+/,angular,internet-explorer-11,polyfills,core-js,Angular,Internet Explorer 11,Polyfills,Core Js,角度10,d3 5.16.0,核心js 3.6.5 其中的长与短是d3 drag调用d3 dispatch,后者在内部调用名为.parseTypenames的方法 function parseTypenames(typenames, types) { return typenames.trim().split(/^|\s+/).map(function (t) { var name = "", i = t.indexOf(".&quo

角度10,d3 5.16.0,核心js 3.6.5

其中的长与短是d3 drag调用d3 dispatch,后者在内部调用名为.parseTypenames的方法

function parseTypenames(typenames, types) {
    return typenames.trim().split(/^|\s+/).map(function (t) {
    var name = "",
        i = t.indexOf(".");
    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
    if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
    return {
      type: t,
      name: name
    };
  });
}
es.string.split.js正在处理/^|\s+/正则表达式

var foo = 'drag'.split(/^|\s+/) // yields an array = ['d','r','a','g'] when i'm expecting ['drag']
有什么建议吗?希望我在使用IE11、Angular 10和D3时没有基本的兼容性问题

提前谢谢。

我想你正在打电话

这发生在core js 3.6.0中,当加载两个不同版本的polyfill时。目前这个问题仍然存在,所以目前的解决方案是确保没有加载两个版本,或者降级到,我认为您正在访问


这发生在core js 3.6.0中,当加载两个不同版本的polyfill时。目前这个问题仍然悬而未决,所以目前的解决方案是确保没有加载两个版本,或者降级到我支持Michael的观点。由于支持y标志,3.6.0版引入了该问题。除了Michael的解决方案外,您还可以参考以下解决方案:

您可以替换polyfills.ts中的以下行:


请注意,导入的regexp和string都有注释。因此,当您的应用程序需要执行拆分时,它使用浏览器的本机功能,而不是core js中的拆分功能。

我支持Michael的观点。由于支持y标志,3.6.0版引入了该问题。除了Michael的解决方案外,您还可以参考以下解决方案:

您可以替换polyfills.ts中的以下行:


请注意,导入的regexp和string都有注释。因此,当您的应用程序需要执行拆分时,它使用浏览器的本机功能,而不是core js中的拆分功能。

我的npm列表中同时存在3.65和3.64 core js的core js依赖项,这肯定是一个问题。这就确定了问题的根源,周瑜的评论提供了暂时解决问题的方法。非常感谢您让我知道core js中的这个问题bug。我肯定有一个问题,3.65和3.64 core js同时出现在我的npm列表中,用于core js依赖项。这就确定了问题的根源,周瑜的评论提供了暂时解决问题的方法。非常感谢您让我知道core-js中的这个问题bug。非常感谢在core js 3.6.5中实现正确的补丁之前的一百万个精彩提示+非常感谢在core js 3.6.5中实现正确的补丁之前的一百万个精彩提示+
npm list | grep core-js
import 'core-js';
import 'core-js/stable/array';
import 'core-js/stable/date';
import 'core-js/stable/function';
import 'core-js/stable/map';
import 'core-js/stable/math';
import 'core-js/stable/number';
import 'core-js/stable/object';
import 'core-js/stable/parse-float';
import 'core-js/stable/parse-int';
// import 'core-js/stable/regexp';
import 'core-js/stable/set';
// import 'core-js/stable/string';
import 'core-js/stable/symbol';
import 'core-js/stable/weak-map';