Skip to content

Commit 66936ff

Browse files
committed
1 parent 857b558 commit 66936ff

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

ui/core/proxy.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import bindable = require("ui/core/bindable");
22
import dependencyObservable = require("ui/core/dependency-observable");
33
import definition = require("ui/core/proxy");
4-
import * as platform from "platform";
54
import * as types from "utils/types";
65
import * as observable from "data/observable";
76

@@ -71,13 +70,20 @@ export class ProxyObject extends bindable.Bindable implements definition.ProxyOb
7170
this._eachSetProperty(eachPropertyCallback);
7271
}
7372

73+
/**
74+
* Checks whether the proxied native object has been created and properties may be applied to it.
75+
*/
76+
protected _canApplyNativeProperty(): boolean {
77+
return false;
78+
}
79+
7480
private _trySetNativeValue(property: dependencyObservable.Property, oldValue?:any, newValue?: any) {
7581
if (this._updatingJSPropertiesDict[property.name]) {
7682
// This is the case when a property has changed from the native side directly and we have received the "_onPropertyChanged" event while synchronizing our local cache
7783
return;
7884
}
7985

80-
if (platform.device.os === platform.platformNames.android && !this.android) {
86+
if (!this._canApplyNativeProperty()) {
8187
// in android we have lazy loading and we do not have a native widget created yet, do not call the onSetNativeValue callback
8288
// properties will be synced when the widget is created
8389
return;

ui/core/view-common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,4 +1165,9 @@ export class View extends ProxyObject implements definition.View {
11651165
public _onStylePropertyChanged(property: Property): void {
11661166
//
11671167
}
1168+
1169+
protected _canApplyNativeProperty(): boolean {
1170+
// Check for a valid _nativeView instance
1171+
return !!this._nativeView;
1172+
}
11681173
}

utils/debug.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ export class Source {
4747
}
4848
}
4949

50-
export class ScopeError implements Error {
50+
export class ScopeError extends Error {
5151
private _child: Error;
5252
private _message: string;
5353

54-
constructor(child: Error, message?: string) {
54+
constructor(child: Error, message?: string) {
55+
super(message);
5556
if (!child) {
5657
throw new Error("Required child error!");
5758
}

0 commit comments

Comments
 (0)