瀏覽代碼

Use constructor instead of syntax sugar

Taichi Masuyama 4 年之前
父節點
當前提交
bad35bbf0e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/core/src/models/devided-page-path.js

+ 1 - 1
packages/core/src/models/devided-page-path.js

@@ -34,7 +34,7 @@ export class DevidedPagePath {
 
     let PATTERN_DEFAULT = /^((.*)\/)?(.+)$/; // https://regex101.com/r/jpZwIe/1
     try { // for non-chrome browsers
-      PATTERN_DEFAULT = /^((.*)(?<!<)\/)?(.+)$/; // https://regex101.com/r/HJNvMW/1
+      PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1
     }
     catch (err) {
       // lookbehind regex is not supported on non-chrome browsers