diff --git a/src/types/observableobject.ts b/src/types/observableobject.ts index 3c01dcedb..6350af2f0 100644 --- a/src/types/observableobject.ts +++ b/src/types/observableobject.ts @@ -182,7 +182,7 @@ export class ObservableObjectAdministration * * When using decorate, the property will always be redeclared as own property on the actual instance */ - return fail( + console.warn( `Property '${propName}' of '${owner}' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner` ) } diff --git a/test/base/observables.js b/test/base/observables.js index 32e4903c2..5db8a2361 100644 --- a/test/base/observables.js +++ b/test/base/observables.js @@ -1669,14 +1669,6 @@ test("Issue 1092 - Should not access attributes of siblings in the prot. chain", // sibling child1 expect(typeof child2.attribute).toBe("undefined") - // We still should be able to read the value from the parent - expect(() => { - child2.staticObservable - }).toThrow(/accessed through the prototype chain/) - expect(() => { - child2.staticObservable = 3 - }).toThrow(/accessed through the prototype chain/) - expect(parent.staticObservable).toBe(11) parent.staticObservable = 12 expect(parent.staticObservable).toBe(12)