Skip to content

Commit

Permalink
Merge pull request #16050 from Dhaulagiri/br-inspect
Browse files Browse the repository at this point in the history
[BUGFIX beta] add inspect and constructor to list of descriptor exceptions
  • Loading branch information
rwjblue authored Jan 5, 2018
2 parents 6976ef7 + b478747 commit 2100ad1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/ember-metal/lib/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ if (EMBER_METAL_ES5_GETTERS) {
// development to aid in development asertions. Production builds of
// ember strip this entire branch out.
let messageFor = function(obj, keyName, property, value) {
return `You attempted to access the \`${keyName}.${property}\` property ` +
return `You attempted to access the \`${keyName}.${String(property)}\` property ` +
`(of ${obj}). Due to certain internal implementation details of Ember, ` +
`the \`${keyName}\` property previously contained an internal "descriptor" ` +
`object (a private API), therefore \`${keyName}.${property}\` would have ` +
`object (a private API), therefore \`${keyName}.${String(property)}\` would have ` +
`been \`${String(value).replace(/\n/g, ' ')}\`. This internal implementation ` +
`detail was never intended to be a public (or even intimate) API.\n\n` +
`This internal implementation detail has now changed and the (still private) ` +
Expand All @@ -112,7 +112,19 @@ if (EMBER_METAL_ES5_GETTERS) {
get(descriptor, property) {
if (property === DESCRIPTOR) {
return descriptor;
} else if (property === 'toString' || property == 'valueOf' || (Symbol && property === Symbol.toPrimitive)) {
} else if (
property === 'prototype' ||
property === 'constructor' ||
property === 'nodeType'
) {
return undefined;
} else if (
property === 'toString' ||
property === 'valueOf' ||
property === 'inspect' ||
Symbol && property === Symbol.toPrimitive ||
Symbol && property === Symbol.toStringTag
) {
return () => '[COMPUTED PROPERTY]';
}

Expand Down

0 comments on commit 2100ad1

Please sign in to comment.