Repository: vuejs/vue
Pull request: Exclude not enumerable keys of inject object

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [x] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [x] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [x] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**

![image](https://user-images.githubusercontent.com/9513647/29203057-cac1ac66-7ea8-11e7-94af-bab4d703f146.PNG)
In `resolveInject` function
If inject parameter object has 'not enumerable' properties, shows error below
![image](https://user-images.githubusercontent.com/9513647/29203103-2aa65bea-7ea9-11e7-9b32-58d711897731.png)

Because
![image](https://user-images.githubusercontent.com/9513647/29203126-52c78cd4-7ea9-11e7-9ec2-d92332a53fa2.png)

result of `Object.keys(inject)` is not equal to `Reflect.ownKeys(inject)` even without symbol




Changed files:
filename: src/core/instance/inject.js
patch: @@ -41,7 +41,9 @@ export function resolveInject (inject: any, vm: Component): ?Object {
     // inject is :any because flow is not smart enough to figure out cached
     const result = Object.create(null)
     const keys = hasSymbol
-        ? Reflect.ownKeys(inject)
+        ? Reflect.ownKeys(inject).filter(key => {
+          return Object.getOwnPropertyDescriptor(inject, key).enumerable
+        })
         : Object.keys(inject)
 
     for (let i = 0; i < keys.length; i++) {

filename: test/unit/features/options/inject.spec.js
patch: @@ -362,7 +362,15 @@ describe('Options provide/inject', () => {
     expect(`Injection "baz" not found`).not.toHaveBeenWarned()
   })
 
-  // GitHub issue #6008
+  it('should not warn when injection key which is not provided is not enumerable', () => {
+    const parent = new Vue({ provide: { foo: 1 }})
+    const inject = { foo: 'foo' }
+    Object.defineProperty(inject, '__ob__', { enumerable: false, value: '__ob__' })
+    new Vue({ parent, inject })
+    expect(`Injection "__ob__" not found`).not.toHaveBeenWarned()
+  })
+
+  // Github issue #6008
   it('should merge provide from mixins (objects)', () => {
     const mixinA = { provide: { foo: 'foo' }}
     const mixinB = { provide: { bar: 'bar' }}