pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <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="owscqiw" 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 的非法構(gòu)造函數(shù)

        Illegal constructor with EcmaScript 6(EcmaScript 6 的非法構(gòu)造函數(shù))

      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="c04qeiu" 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 的非法構(gòu)造函數(shù)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  首先我想說的是,我真的不知道如何解釋我做了什么才能得到標(biāo)題中提到的錯(cuò)誤(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);
                  }
                  

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

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

                  在瀏覽器控制臺(tái)(Chrome 或 Firefox)中,錯(cuò)誤出現(xiàn)并且位于下一行:

                  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 因?yàn)槲覜]有在其他模塊中導(dǎo)入模塊(這不是必需的,因?yàn)槊總€(gè)文件都轉(zhuǎn)換為一個(gè)文件,所有內(nèi)容都可以訪問).

                  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).

                  我做了一些研究,人們得到這個(gè)錯(cuò)誤的唯一原因是因?yàn)橛幸粋€(gè)大寫字母是不允許的.我沒有找到有關(guān)此錯(cuò)誤原因的任何其他信息.有人知道我為什么會(huì)收到此錯(cuò)誤嗎?有人有解決方案嗎?

                  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?

                  推薦答案

                  看起來你正在嘗試擴(kuò)展 DOM 的 節(jié)點(diǎn).你不能這樣做,它被定義為一個(gè)抽象接口,并且在瀏覽器中公開的主機(jī)提供的函數(shù)不能作為構(gòu)造函數(shù)調(diào)用(即使是子類).

                  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).

                  這篇關(guān)于EcmaScript 6 的非法構(gòu)造函數(shù)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運(yùn)行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個(gè)接一個(gè)地依次運(yùn)行 Gulp 任務(wù))
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時(shí) 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="imqgwam" 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. 主站蜘蛛池模板: 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 单螺旋速冻机-双螺旋-流态化-隧道式-食品速冻机厂家-广州冰泉制冷 | 517瓜水果特产网|一个专注特产好物的网站 | 铣床|万能铣床|立式铣床|数控铣床|山东滕州万友机床有限公司 | 减速机三参数组合探头|TSM803|壁挂式氧化锆分析仪探头-安徽鹏宸电气有限公司 | 智能楼宇-楼宇自控系统-楼宇智能化-楼宇自动化-三水智能化 | 皮带输送机-大倾角皮带输送机-皮带输送机厂家-河南坤威机械 | 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 | 低温柔性试验仪-土工布淤堵-沥青车辙试验仪-莱博特(天津)试验机有限公司 | 一体化隔油提升设备-餐饮油水分离器-餐厨垃圾处理设备-隔油池-盐城金球环保产业发展有限公司 | 政府回应:200块在义乌小巷能买到爱情吗?——揭秘打工族省钱约会的生存智慧 | 托利多电子平台秤-高精度接线盒-托利多高精度电子秤|百科 | 青岛球场围网,青岛车间隔离网,青岛机器人围栏,青岛水源地围网,青岛围网,青岛隔离栅-青岛晟腾金属制品有限公司 | 铝镁锰板_铝镁锰合金板_铝镁锰板厂家_铝镁锰金属屋面板_安徽建科 | 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 电机铸铝配件_汽车压铸铝合金件_发动机压铸件_青岛颖圣赫机械有限公司 | 气力输送设备_料封泵_仓泵_散装机_气化板_压力释放阀-河南锐驰机械设备有限公司 | 专业甜品培训学校_广东糖水培训_奶茶培训_特色小吃培训_广州烘趣甜品培训机构 | 冷库安装厂家_杭州冷库_保鲜库建设-浙江克冷制冷设备有限公司 | 电力电子产业网 | 全自动定氮仪-半自动凯氏定氮仪厂家-祎鸿仪器 | 风化石头制砂机_方解石制砂机_瓷砖石子制砂机_华盛铭厂家 | 超声波破碎仪-均质乳化机(供应杭州,上海,北京,广州,深圳,成都等地)-上海沪析实业有限公司 | 高精度-恒温冷水机-螺杆式冰水机-蒸发冷冷水机-北京蓝海神骏科技有限公司 | 耐火浇注料价格-高强高铝-刚玉碳化硅耐磨浇注料厂家【直销】 | 高博医疗集团上海阿特蒙医院 | IHDW_TOSOKU_NEMICON_EHDW系列电子手轮,HC1系列电子手轮-上海莆林电子设备有限公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 防堵吹扫装置-防堵风压测量装置-电动操作显示器-兴洲仪器 | Win10系统下载_32位/64位系统/专业版/纯净版下载 | 广东高华家具-公寓床|学生宿舍双层铁床厂家【质保十年】 | 节流截止放空阀-不锈钢阀门-气动|电动截止阀-鸿华阀门有限公司 | 高铝砖-高铝耐火球-高铝耐火砖生产厂家-价格【荣盛耐材】 | 热风机_工业热风机生产厂家上海冠顶公司提供专业热风机图片价格实惠 | 电子海图系统-电梯检验系统-智慧供热系统开发-商品房预售资金监管系统 | 房间温控器|LonWorks|海思| 橡胶膜片,夹布膜片,橡胶隔膜密封,泵阀设备密封膜片-衡水汉丰橡塑科技公司网站 | 防水套管厂家_刚性防水套管_柔性防水套管_不锈钢防水套管-郑州中泰管道 | 昆山新莱洁净应用材料股份有限公司-卫生级蝶阀,无菌取样阀,不锈钢隔膜阀,换向阀,离心泵 | 奥运星-汽车性能网评-提供个性化汽车资讯 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 |