Skip to content

Commit

Permalink
Merge pull request #16613 from rwjblue/fix-engines-regression
Browse files Browse the repository at this point in the history
[BUGFIX release] Prevent errors in ember-engines + 3.1 + proxies.
  • Loading branch information
rwjblue authored May 8, 2018
2 parents 2eec208 + b369d1c commit 4c976f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/ember-runtime/lib/system/core_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function makeCtor(base) {
property === 'didAddListener' ||
property === 'didRemoveListener' ||
property === 'isDescriptor' ||
property === '_onLookup' ||
property in target
) {
return Reflect.get(target, property, receiver);
Expand Down
20 changes: 19 additions & 1 deletion packages/ember-runtime/tests/system/core_object_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getOwner, setOwner } from 'ember-owner';
import { get } from 'ember-metal';
import CoreObject from '../../lib/system/core_object';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
import { moduleFor, AbstractTestCase, buildOwner } from 'internal-test-helpers';

moduleFor(
'Ember.CoreObject',
Expand Down Expand Up @@ -62,6 +62,24 @@ moduleFor(
assert.equal(get(proxy, 'lolol'), true, 'should be able to get data from a proxy');
}

['@test should not trigger proxy assertion when retrieving a re-registered proxy (GH#16610)'](
assert
) {
let owner = buildOwner();

let someProxyishThing = CoreObject.extend({
unknownProperty() {
return true;
},
}).create();

// emulates ember-engines's process of registering services provided
// by the host app down to the engine
owner.register('thing:one', someProxyishThing, { instantiate: false });

assert.equal(owner.lookup('thing:one'), someProxyishThing);
}

['@test should not trigger proxy assertion when probing for a "symbol"'](assert) {
let proxy = CoreObject.extend({
unknownProperty() {
Expand Down

0 comments on commit 4c976f8

Please sign in to comment.