-
Creator 版本:
-
目标平台:
-
重现方式:
-
首个报错:
-
之前哪个版本是正常的:
-
手机型号:
-
手机浏览器:
-
编辑器操作系统:
-
重现概率:
自定义两个类 ANode Actor 设置Actor 继承ANode ANode没有父类
@ccclass(‘ANode’)
export class ANode {
public node: Node = null!;
constructor(…params: any) {
this.node = new Node();
}
}
@ccclass(‘Actor’)
export class Actor extends ANode {
constructor(…params: any) {
super(params);
}
}
发布为 web-mobile
var ccclass = _decorator.ccclass;
var Actor = exports(‘Actor’, (_dec = ccclass(‘Actor’), _dec(_class = (_temp = /#PURE/function (_ANode) {
:10095 _inheritsLoose(Actor, _ANode);
function Actor() {
var _this;
执行些函数时 superClass 为undefined
function _inheritsLoose(subClass, superClass) {
:52 subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
求原因,因很多类对ANode进行继承 问题都同上 一直查不出原因来
执行_inheritsLoose函数 superClass为空,然后不报错了
TypeError: Cannot read property ‘prototype’ of undefined
at _inheritsLoose (bundle.js:52)
at index.js:10095
at Object.execute (index.js:10223)
at doExec (system.bundle.js:467)
at postOrderExec (system.bundle.js:463)
at system.bundle.js:449
at Array.forEach ()
at postOrderExec (system.bundle.js:447)
at system.bundle.js:449
at Array.forEach ()