Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions cocos/core/data/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
if (CCClass.getInheritanceChain(cls)
// eslint-disable-next-line no-prototype-builtins
.some((x) => x.prototype.hasOwnProperty(propName))) {
errorID(3637, className, propName, className);

Check failure on line 81 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `StringSubstitution`

Check failure on line 81 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `StringSubstitution`

Check failure on line 81 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `StringSubstitution`

Check failure on line 81 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `StringSubstitution`

Check failure on line 81 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `StringSubstitution`

Check failure on line 81 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `StringSubstitution`
return;
}
}
Expand All @@ -86,10 +86,10 @@
appendProp(cls, propName);

// apply attributes
parseAttributes(cls, val, className, propName, false);

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `PropertyStash`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `Function`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `PropertyStash`

Check failure on line 89 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `Function`
if ((EDITOR && !window.Build) || TEST) {
for (let i = 0; i < onAfterProps_ET.length; i++) {
onAfterProps_ET[i](cls, propName);

Check failure on line 92 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 92 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `Function`

Check failure on line 92 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 92 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `Function`
}
onAfterProps_ET.length = 0;
}
Expand All @@ -100,7 +100,7 @@
const setter = val.set;

if (getter) {
parseAttributes(cls, val, name, propName, true);

Check failure on line 103 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `Function`

Check failure on line 103 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `Function`
if ((EDITOR && !window.Build) || TEST) {
onAfterProps_ET.length = 0;
}
Expand Down Expand Up @@ -195,22 +195,15 @@
renderName = 'render_stage';
}
// 增加了 hidden: 开头标识,使它最终不会显示在 Editor inspector 的添加组件列表里
if (globalThis.EditorExtends) {
globalThis.EditorExtends.Component.addMenu(cls, `hidden:${renderName}/${className}`, -1);
}

window.EditorExtends && window.EditorExtends.Component.addMenu(cls, `hidden:${renderName}/${className}`, -1);

Check warning on line 199 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected an assignment or function call and instead saw an expression

Check warning on line 199 in cocos/core/data/class.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected an assignment or function call and instead saw an expression
}

// Note: `options.ctor` should be the same as `cls` except if
// cc-class is defined by `cc.Class({/* ... */})`.
// In such case, `options.ctor` may be `undefined`.
// So we can not use `options.ctor`. Instead, we should use `cls` which is the "real" registered cc-class.
// Emit via globalThis.EditorExtends to ensure the event reaches
// both the engine-internal and the scene-bundle event systems.
if (globalThis.EditorExtends) {
globalThis.EditorExtends.emit('class-registered', cls, frame, className);
} else {
EditorExtends.emit('class-registered', cls, frame, className);
}
EditorExtends.emit('class-registered', cls, frame, className);
}

if (frame) {
Expand Down
Loading