Skip to content

Commit

Permalink
[BUGFIX release] Adds toJSON to list of descriptorTrap assertion exce…
Browse files Browse the repository at this point in the history
…ption
  • Loading branch information
mani-mishra committed Mar 9, 2018
1 parent a28755d commit 6bd74a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/ember-metal/lib/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ if (EMBER_METAL_ES5_GETTERS) {
property === 'toString' ||
property === 'valueOf' ||
property === 'inspect' ||
property === 'toJSON' ||
Symbol && property === Symbol.toPrimitive ||
Symbol && property === Symbol.toStringTag
) {
Expand All @@ -148,6 +149,7 @@ if (EMBER_METAL_ES5_GETTERS) {
});

trap.toString = trap.valueOf = () => '[COMPUTED PROPERTY]';
trap.toJSON = trap.valueOf = () => '[COMPUTED PROPERTY]';

// Without a proxy, we can only trap the "likely" properties
['isDescriptor', 'setup', 'teardown', 'get', '_getter', 'set', '_setter', 'meta'].forEach(property => {
Expand Down

0 comments on commit 6bd74a4

Please sign in to comment.