久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='i77Zt'></bdo><ul id='i77Zt'></ul>

    1. <tfoot id='i77Zt'></tfoot>

    2. <i id='i77Zt'><tr id='i77Zt'><dt id='i77Zt'><q id='i77Zt'><span id='i77Zt'><b id='i77Zt'><form id='i77Zt'><ins id='i77Zt'></ins><ul id='i77Zt'></ul><sub id='i77Zt'></sub></form><legend id='i77Zt'></legend><bdo id='i77Zt'><pre id='i77Zt'><center id='i77Zt'></center></pre></bdo></b><th id='i77Zt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i77Zt'><tfoot id='i77Zt'></tfoot><dl id='i77Zt'><fieldset id='i77Zt'></fieldset></dl></div>
      <legend id='i77Zt'><style id='i77Zt'><dir id='i77Zt'><q id='i77Zt'></q></dir></style></legend>

      <small id='i77Zt'></small><noframes id='i77Zt'>

      1. EcmaScript 6 的非法構造函數

        Illegal constructor with EcmaScript 6(EcmaScript 6 的非法構造函數)

      2. <i id='7xomG'><tr id='7xomG'><dt id='7xomG'><q id='7xomG'><span id='7xomG'><b id='7xomG'><form id='7xomG'><ins id='7xomG'></ins><ul id='7xomG'></ul><sub id='7xomG'></sub></form><legend id='7xomG'></legend><bdo id='7xomG'><pre id='7xomG'><center id='7xomG'></center></pre></bdo></b><th id='7xomG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7xomG'><tfoot id='7xomG'></tfoot><dl id='7xomG'><fieldset id='7xomG'></fieldset></dl></div>

          <small id='7xomG'></small><noframes id='7xomG'>

          <legend id='7xomG'><style id='7xomG'><dir id='7xomG'><q id='7xomG'></q></dir></style></legend>
            <bdo id='7xomG'></bdo><ul id='7xomG'></ul>
              <tbody id='7xomG'></tbody>
                  <tfoot id='7xomG'></tfoot>

                  本文介紹了EcmaScript 6 的非法構造函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  首先我想說的是,我真的不知道如何解釋我做了什么才能得到標題中提到的錯誤(uncaught TypeError: Illegal constructor).我正在使用 gulpfile 將我的 Ecmascript 6 編譯為純 Javascript.我的 gulpfile 看起來像這樣:

                  First of all I would like that say that I don't really know how I can explain what I did on order to get the error mentioned in the title (uncaught TypeError: Illegal constructor). I am using gulpfile in order to compile my Ecmascript 6 to plain Javascript. My gulpfile looks like this:

                  var gulp = require('gulp');
                  var concat = require('gulp-concat');
                  var babel = require('gulp-babel');
                  
                  gulp.task('compile', function () {
                      return gulp.src(['resources/assets/js/*.js', 'resources/assets/js/components/*.js'])
                          .pipe(babel({
                                  presets: ['es2015']
                          }).on('error', logError))
                          .pipe(concat('bundle.js'))
                          .pipe(gulp.dest('public/js'));
                  });
                  
                  gulp.task('watch', function () {
                     gulp.watch('resources/assets/js/**/*', ['compile']);
                  })
                  
                  gulp.task('default', ['watch']);
                  
                  function logError(err) {
                      console.log(err);
                  }
                  

                  我有一個文件系統,在使用 Babel 編譯后,所有文件都連接到一個文件 (bundle.js).

                  I have a filesystem where all files are concatenated to one file (bundle.js), after being compiled with Babel.

                  在瀏覽器控制臺(Chrome 或 Firefox)中,錯誤出現并且位于下一行:

                  In the browsers console (either Chrome or Firefox), the error appears and it is located in the next line:

                  var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, element));
                  

                  這是未編譯的代碼:

                  class Dropdown extends Node {
                  
                      constructor(element) {
                          super(element);
                  
                          this.registerEvents(['click', 'change', 'blur']);
                      }
                  
                      onClick() {
                          this.$element.addClass('clicked');
                      }
                  }
                  

                  這是同一類的編譯代碼:

                  And this is the compiled code of the same class:

                  var Dropdown = function (_Node) {
                      _inherits(Dropdown, _Node);
                  
                      function Dropdown(element) {
                          _classCallCheck(this, Dropdown);
                  
                          var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, element));
                  
                          _this.registerEvents(['click', 'change', 'blur']);
                  
                          return _this;
                      }
                  
                      _createClass(Dropdown, [{
                          key: 'onClick',
                          value: function onClick() {
                              this.$element.addClass('clicked');
                          }
                      }]);
                  
                      return Dropdown;
                  }(Node);
                  

                  我沒有使用 export default Dropdown 因為我沒有在其他模塊中導入模塊(這不是必需的,因為每個文件都轉換為一個文件,所有內容都可以訪問).

                  I am not using export default Dropdown because I am not importing modules in other modules (this is not needed because every file is converted to one file, where everything is accessible).

                  我做了一些研究,人們得到這個錯誤的唯一原因是因為有一個大寫字母是不允許的.我沒有找到有關此錯誤原因的任何其他信息.有人知道我為什么會收到此錯誤嗎?有人有解決方案嗎?

                  I did some research and the only reason why peoeple got this error was because there was a capital letter where none was allowed. I didn't find anything else about the cause of this error. Does someone have an idea why I get this error? And does someone have a solution?

                  推薦答案

                  看起來你正在嘗試擴展 DOM 的 節點.你不能這樣做,它被定義為一個抽象接口,并且在瀏覽器中公開的主機提供的函數不能作為構造函數調用(即使是子類).

                  It looks like you're trying to extend DOM's Node. You can't do that, it's defined as an abstract interface, and the host-provided function exposed in browsers for it can't be called as a constructor (even by subclasses).

                  這篇關于EcmaScript 6 的非法構造函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)

                  <small id='pusGt'></small><noframes id='pusGt'>

                  • <bdo id='pusGt'></bdo><ul id='pusGt'></ul>
                      <tbody id='pusGt'></tbody>
                  • <i id='pusGt'><tr id='pusGt'><dt id='pusGt'><q id='pusGt'><span id='pusGt'><b id='pusGt'><form id='pusGt'><ins id='pusGt'></ins><ul id='pusGt'></ul><sub id='pusGt'></sub></form><legend id='pusGt'></legend><bdo id='pusGt'><pre id='pusGt'><center id='pusGt'></center></pre></bdo></b><th id='pusGt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pusGt'><tfoot id='pusGt'></tfoot><dl id='pusGt'><fieldset id='pusGt'></fieldset></dl></div>

                    1. <tfoot id='pusGt'></tfoot>
                    2. <legend id='pusGt'><style id='pusGt'><dir id='pusGt'><q id='pusGt'></q></dir></style></legend>

                          1. 主站蜘蛛池模板: 二区三区av | 成人高清视频在线观看 | 久久久久久久久毛片 | 三级成人在线观看 | 色综合久久久 | 午夜激情一区 | 欧美成年人视频在线观看 | 国产性网 | 久久久久久国产精品三区 | 国产精品久久久久久久久久久久久 | 狠狠色综合欧美激情 | 四虎影院在线观看免费视频 | 天天久久 | 欧美高清hd | 粉嫩一区二区三区四区公司1 | 欧美日韩不卡 | 成在线人视频免费视频 | 亚洲视频区 | 99re视频| 免费视频一区二区 | 欧美成人二区 | 日本又色又爽又黄又高潮 | 亚洲精品自在在线观看 | 欧美日韩网站 | 亚洲综合在线视频 | 久久久久国产一级毛片高清网站 | 日本一卡精品视频免费 | 另类视频在线 | 日本高清在线一区 | www.日本三级 | 国产精品久久久久久久午夜片 | 91精品国产色综合久久 | 午夜免费观看体验区 | 在线观看的av | 成人黄色电影在线观看 | 日韩精品一区二区久久 | 成人精品在线视频 | 激情91 | 亚洲精品一区二区三区蜜桃久 | 免费人成激情视频在线观看冫 | 日本不卡免费新一二三区 |