Skip to content

Commit

Permalink
Merge pull request #1529 from AmazingTurtle/patch-1
Browse files Browse the repository at this point in the history
Changed illegal access error to a warning
  • Loading branch information
mweststrate authored May 22, 2018
2 parents b0371bf + e61e8c9 commit ac79559
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion src/types/observableobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
}
Expand Down
8 changes: 0 additions & 8 deletions test/base/observables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ac79559

Please sign in to comment.