Skip to content

Commit

Permalink
Slightly better handling of #1506
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed May 22, 2018
1 parent a5f5793 commit d40b258
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/types/observableobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,17 @@ export class ObservableObjectAdministration
constructor(public target: any, public name: string, public defaultEnhancer: IEnhancer<any>) {}

read(owner: any, key: string) {
if (this.target !== owner) {
if (process.env.NODE_ENV === "production" && this.target !== owner) {
this.illegalAccess(owner, key)
return
if (!this.values[key]) return undefined
}
return this.values[key].get()
}

write(owner: any, key: string, newValue) {
const instance = this.target
if (instance !== owner) {
if (process.env.NODE_ENV === "production" && instance !== owner) {
this.illegalAccess(owner, key)
return
}
const observable = this.values[key]
if (observable instanceof ComputedValue) {
Expand Down

0 comments on commit d40b258

Please sign in to comment.