-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor(core): Inline Vue ViewModel checks in normalize and safeJoin #19855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import type { Primitive } from '../types-hoist/misc'; | ||
| import { isSyntheticEvent, isVueViewModel } from './is'; | ||
| import { isSyntheticEvent } from './is'; | ||
| import { convertToPlainObject } from './object'; | ||
| import { getFunctionName, getVueInternalName } from './stacktrace'; | ||
| import { getFunctionName } from './stacktrace'; | ||
|
|
||
| type Prototype = { constructor?: (...args: unknown[]) => unknown }; | ||
| // This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we | ||
|
|
@@ -216,8 +216,12 @@ function stringifyValue( | |
| return '[Document]'; | ||
| } | ||
|
|
||
| if (isVueViewModel(value)) { | ||
| return getVueInternalName(value); | ||
| if ( | ||
| typeof value === 'object' && | ||
| value !== null && | ||
| ('__isVue' in value || '_isVue' in value || '__v_isVNode' in value) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Property existence check differs from original truthiness checkLow Severity The inlined check uses Additional Locations (1) |
||
| ) { | ||
| return '__v_isVNode' in value && value.__v_isVNode ? '[VueVNode]' : '[VueViewModel]'; | ||
| } | ||
|
|
||
| // React's SyntheticEvent thingy | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.