Skip to content

Key paths containing javascript built-ins are handled inconsistently #1838

Open
@alxndrsn

Description

@alxndrsn

Reporting a bug?

Similar to vue-i18n, using javascript builtins in key paths can have surprising results.

Ref:

Expected behavior

Keys should be handled consistently, or explicitly rejected if not supported.

Reproduction

https://github.com/intlify/vue-i18n-next/compare/master...alxndrsn:builtins?expand=1#diff-38b7f4833b6d1b2e7a9f81900841139df0e91381af1eae14cdb1f1ce432f465a

Example results:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 18 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > constructor > top-level props > with not existing key > te() > should return false
 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > hasOwnProperty > top-level props > with not existing key > te() > should return false
 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > isPrototypeOf > top-level props > with not existing key > te() > should return false
 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > propertyIsEnumerable > top-level props > with not existing key > te() > should return false
 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > toLocaleString > top-level props > with not existing key > te() > should return false
 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > toString > top-level props > with not existing key > te() > should return false
 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > valueOf > top-level props > with not existing key > te() > should return false
AssertionError: expected true to deeply equal false

- Expected
+ Received

- false
+ true

 ❯ packages/vue-i18n-core/test/issues.test.ts:1486:41
    1484|               const i18n = i18nFor({})
    1485| 
    1486|               expect(i18n.global.te(k)).toEqual(false)
       |                                         ^
    1487|             })
    1488|           })

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > constructor > top-level props > with not existing key > t() > should return key
SyntaxError: Unexpected return type in composer
 ❯ Module.createCompileError packages/message-compiler/src/errors.ts:92:17
     90|     ? format((messages || errorMessages)[code] || '', ...(args || []))
     91|     : code
     92|   const error = new SyntaxError(String(msg)) as CompileError
       |                 ^
     93|   error.code = code
     94|   if (loc) {
 ❯ Module.createI18nError packages/vue-i18n-core/src/errors.ts:41:10
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2282:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 24, domain: undefined }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > hasOwnProperty > top-level props > with existing key > t() > should return hi
TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
 ❯ hasOwnProperty node_modules/.pnpm/@[email protected]/node_modules/@vue/reactivity/dist/reactivity.cjs.js:452:14
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1475:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > hasOwnProperty > top-level props > with not existing key > t() > should return key
TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
 ❯ hasOwnProperty node_modules/.pnpm/@[email protected]/node_modules/@vue/reactivity/dist/reactivity.cjs.js:452:14
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > hasOwnProperty > mid-level props > with existing key > te() > should return true
AssertionError: expected false to deeply equal true

- Expected
+ Received

- true
+ false

 ❯ packages/vue-i18n-core/test/issues.test.ts:1515:41
    1513|               })
    1514| 
    1515|               expect(i18n.global.te(k)).toEqual(true)
       |                                         ^
    1516|             })
    1517|           })

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > hasOwnProperty > mid-level props > with existing key > t() > should return hi
AssertionError: expected 'a.hasOwnProperty.c' to deeply equal 'hi'

- Expected
+ Received

- hi
+ a.hasOwnProperty.c

 ❯ packages/vue-i18n-core/test/issues.test.ts:1531:40
    1529|               })
    1530| 
    1531|               expect(i18n.global.t(k)).toEqual('hi')
       |                                        ^
    1532|             })
    1533|           })

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > hasOwnProperty > deep props > with existing key > t() > should return hi
TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
 ❯ hasOwnProperty node_modules/.pnpm/@[email protected]/node_modules/@vue/reactivity/dist/reactivity.cjs.js:452:14
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1585:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > isPrototypeOf > top-level props > with not existing key > t() > should return key
TypeError: Cannot convert undefined or null to object
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > propertyIsEnumerable > top-level props > with not existing key > t() > should return key
TypeError: Cannot convert undefined or null to object
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > toLocaleString > top-level props > with not existing key > t() > should return key
TypeError: Object.prototype.toLocaleString called on null or undefined
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > toString > top-level props > with not existing key > t() > should return key
AssertionError: expected '[object Undefined]' to deeply equal 'toString'

- Expected
+ Received

- toString
+ [object Undefined]

 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:40
    1493|               const i18n = i18nFor({})
    1494| 
    1495|               expect(i18n.global.t(k)).toEqual(k)
       |                                        ^
    1496|             })
    1497|           })

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/18]⎯

 FAIL  packages/vue-i18n-core/test/issues.test.ts > #TODO > valueOf > top-level props > with not existing key > t() > should return key
TypeError: Cannot convert undefined or null to object
 ❯ evaluateMessage packages/core-base/src/translate.ts:1016:20
    1014|   }
    1015| 
    1016|   const messaged = msg(msgCtx)
       |                    ^
    1017| 
    1018|   // for vue-devtools timeline event
 ❯ translate packages/core-base/src/translate.ts:757:20
 ❯ packages/vue-i18n-core/src/composer.ts:2289:26
 ❯ wrapWithDeps packages/vue-i18n-core/src/composer.ts:2227:13
 ❯ Object.t packages/vue-i18n-core/src/composer.ts:2288:12
 ❯ Object.t packages/vue-i18n-core/src/legacy.ts:1708:22
 ❯ packages/vue-i18n-core/test/issues.test.ts:1495:34

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/18]⎯

 Test Files  1 failed | 51 passed (52)
      Tests  18 failed | 707 passed | 35 skipped | 37 todo (797)
   Start at  14:26:57
   Duration  19.59s (transform 2.26s, setup 11ms, collect 10.52s, tests 3.87s, environment 16.22s, prepare 10.85s)

 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "test:cover" exited with 1.
 ELIFECYCLE  Test failed. See above for more details.

System Info

N/A

Screenshot

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: PR WelcomeWelcome to Pull RequestType: BugBug or Bug fixes🔨 p3-minor-bugPriority 3: a bug in an edge case that only affects very specific usage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions