Match-id-9ffb3423d9cbe56ad4f381a2e50b90f7caa403ff

This commit is contained in:
* 2023-05-23 21:02:58 +08:00
parent 537c48e656
commit a4671aa06f
4 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,6 @@
## 0.0.50 (2023-05-23)
- **core**: 解决IE11不兼容Symbol问题
## 0.0.49 (2023-05-19)
- **core**: 解决当组件被销毁业务若异步定时器调用setState修改状态可能出现路径错误问题。

View File

@ -4,7 +4,7 @@
"keywords": [
"horizon"
],
"version": "0.0.49",
"version": "0.0.50",
"homepage": "",
"bugs": "",
"main": "index.js",

View File

@ -40,6 +40,14 @@ export function JSXElement(type, key, ref, vNode, props, source: Source | null)
// 所属的class组件,clonedeep jsxElement时需要防止无限循环
[BELONG_CLASS_VNODE_KEY]: vNode,
};
// 兼容IE11不支持Symbol
if (typeof BELONG_CLASS_VNODE_KEY === 'string') {
Object.defineProperty(ele, BELONG_CLASS_VNODE_KEY, {
configurable: false,
enumerable: false,
value: vNode,
});
}
if (isDev) {
// 为了test判断两个 JSXElement 对象是否相等时忽略src属性需要设置src的enumerable为false
Object.defineProperty(ele, 'src', {

View File

@ -38,7 +38,7 @@ import type { Hook } from '../hooks/HookType';
import { InitFlag } from './VNodeFlags';
import { Observer } from '../../horizonx/proxy/Observer';
export const BELONG_CLASS_VNODE_KEY = Symbol('belongClassVNode');
export const BELONG_CLASS_VNODE_KEY = typeof Symbol === 'function' ? Symbol('belongClassVNode') : 'belongClassVNode';
export class VNode {
tag: VNodeTag;