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. 主站蜘蛛池模板: 电磁辐射仪-电磁辐射检测仪-pm2.5检测仪-多功能射线检测仪-上海何亦仪器仪表有限公司 | 除湿机|工业除湿机|抽湿器|大型地下室车间仓库吊顶防爆除湿机|抽湿烘干房|新风除湿机|调温/降温除湿机|恒温恒湿机|加湿机-杭州川田电器有限公司 | 深圳公司注册-工商注册代理-注册公司流程和费用_护航财税 | 北钻固控设备|石油钻采设备-石油固控设备厂家 | 预制舱-电力集装箱预制舱-模块化预制舱生产厂家-腾达电器设备 | 粉末包装机-给袋式包装机-全自动包装机-颗粒-液体-食品-酱腌菜包装机生产线【润立机械】 | 德州网站开发定制-小程序开发制作-APP软件开发-「两山开发」 | Win10系统下载_32位/64位系统/专业版/纯净版下载 | 电竞学校_电子竞技培训学校学院-梦竞未来电竞学校官网 | 合肥网带炉_安徽箱式炉_钟罩炉-合肥品炙装备科技有限公司 | 超声波破碎仪-均质乳化机(供应杭州,上海,北京,广州,深圳,成都等地)-上海沪析实业有限公司 | 玻纤土工格栅_钢塑格栅_PP焊接_单双向塑料土工格栅_复合防裂布厂家_山东大庚工程材料科技有限公司 | 网站优化公司_北京网站优化_抖音短视频代运营_抖音关键词seo优化排名-通则达网络 | 庭院灯_太阳能景观灯_草坪灯厂家_仿古壁灯-重庆恒投科技 | 阜阳成人高考_阜阳成考报名时间_安徽省成人高考网 | 陶瓷加热器,履带式加热器-吴江市兴达电热设备厂 | 电动卫生级调节阀,电动防爆球阀,电动软密封蝶阀,气动高压球阀,气动对夹蝶阀,气动V型调节球阀-上海川沪阀门有限公司 | Pos机办理_个人商户免费POS机申请-拉卡拉办理网 | 手术示教系统-数字化手术室系统-林之硕医疗云智能视频平台 | 环氧乙烷灭菌器_压力蒸汽灭菌器_低温等离子过氧化氢灭菌器 _低温蒸汽甲醛灭菌器_清洗工作站_医用干燥柜_灭菌耗材-环氧乙烷灭菌器_脉动真空压力蒸汽灭菌器_低温等离子灭菌设备_河南省三强医疗器械有限责任公司 | 高温高压釜(氢化反应釜)百科 | 上海办公室设计_办公楼,写字楼装修_办公室装修公司-匠御设计 | 冲击式破碎机-冲击式制砂机-移动碎石机厂家_青州市富康机械有限公司 | 七维官网-水性工业漆_轨道交通涂料_钢结构漆 | 钢化玻璃膜|手机钢化膜|钢化膜厂家|手机保护膜-【东莞市大象电子科技有限公司】 | 上海冠顶工业设备有限公司-隧道炉,烘箱,UV固化机,涂装设备,高温炉,工业机器人生产厂家 | ?水马注水围挡_塑料注水围挡_防撞桶-常州瑞轩水马注水围挡有限公司 | 激光内雕_led玻璃_发光玻璃_内雕玻璃_导光玻璃-石家庄明晨三维科技有限公司 激光内雕-内雕玻璃-发光玻璃 | 山东螺杆空压机,烟台空压机,烟台开山空压机-烟台开山机电设备有限公司 | 河北中仪伟创试验仪器有限公司是专业生产沥青,土工,水泥,混凝土等试验仪器的厂家,咨询电话:13373070969 | 上海办公室装修公司_办公室设计_直营办公装修-羚志悦装 | Boden齿轮油泵-ketai齿轮泵-yuken油研-无锡新立液压有限公司 | 电主轴,车床电磨头,变频制动电机-博山鸿达特种电机 | 除湿机|工业除湿机|抽湿器|大型地下室车间仓库吊顶防爆除湿机|抽湿烘干房|新风除湿机|调温/降温除湿机|恒温恒湿机|加湿机-杭州川田电器有限公司 | 净化车间_洁净厂房_净化公司_净化厂房_无尘室工程_洁净工程装修|改造|施工-深圳净化公司 | 福建珂朗雅装饰材料有限公司「官方网站」 | 轴承振动测量仪电箱-轴承测振动仪器-测试仪厂家-杭州居易电气 | 济南品牌设计-济南品牌策划-即合品牌策划设计-山东即合官网 | 工业车间焊接-整体|集中除尘设备-激光|等离子切割机配套除尘-粉尘烟尘净化治理厂家-山东美蓝环保科技有限公司 | 绿萝净除甲醛|深圳除甲醛公司|测甲醛怎么收费|培训机构|电影院|办公室|车内|室内除甲醛案例|原理|方法|价格立马咨询 | 医用酒精_84消毒液_碘伏消毒液等医用消毒液-漓峰消毒官网 |