-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(runtime-core): use same internal object mechanism for slots
close #10709
- Loading branch information
Showing
4 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Used during vnode props/slots normalization to check if the vnode props/slots | ||
* are the internal attrs / slots object of a component via | ||
* `Object.getPrototypeOf`. This is more performant than defining a | ||
* non-enumerable property. (one of the optimizations done for ssr-benchmark) | ||
*/ | ||
const internalObjectProto = Object.create(null) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
yyx990803
Author
Member
|
||
|
||
export const createInternalObject = () => Object.create(internalObjectProto) | ||
|
||
export const isInternalObject = (obj: object) => | ||
Object.getPrototypeOf(obj) === internalObjectProto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
why not "Object.create({})"