potential es6 -> es5 code robust
This commit is contained in:
parent
fb47613b89
commit
a069cd7178
@ -194,11 +194,12 @@ export function jsObtainContext(id: string) {
|
|||||||
|
|
||||||
export function jsReleaseContext(id: string) {
|
export function jsReleaseContext(id: string) {
|
||||||
const context = gContexts.get(id)
|
const context = gContexts.get(id)
|
||||||
|
const args = arguments
|
||||||
if (context) {
|
if (context) {
|
||||||
timerInfos.forEach((v, k) => {
|
timerInfos.forEach((v, k) => {
|
||||||
if (v.context === context) {
|
if (v.context === context) {
|
||||||
if (global.nativeClearTimer === undefined) {
|
if (global.nativeClearTimer === undefined) {
|
||||||
return Reflect.apply(_clearTimeout, undefined, arguments)
|
return Reflect.apply(_clearTimeout, undefined, args)
|
||||||
}
|
}
|
||||||
timerInfos.delete(k)
|
timerInfos.delete(k)
|
||||||
nativeClearTimer(k)
|
nativeClearTimer(k)
|
||||||
|
@ -367,9 +367,11 @@ export abstract class Superview extends View {
|
|||||||
toModel() {
|
toModel() {
|
||||||
const subviews = []
|
const subviews = []
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
v.superview = this
|
if (v != undefined) {
|
||||||
if (v.isDirty()) {
|
v.superview = this
|
||||||
subviews.push(v.toModel())
|
if (v.isDirty()) {
|
||||||
|
subviews.push(v.toModel())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.dirtyProps.subviews = subviews
|
this.dirtyProps.subviews = subviews
|
||||||
|
Reference in New Issue
Block a user