mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
refactor: update runtime code for primordial check x in y (#13642)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
This commit is contained in:
parent
8b31fc23cd
commit
0bb96cde72
7 changed files with 65 additions and 37 deletions
|
@ -57,6 +57,7 @@
|
|||
ReflectApply,
|
||||
ReflectDefineProperty,
|
||||
ReflectGetOwnPropertyDescriptor,
|
||||
ReflectHas,
|
||||
ReflectOwnKeys,
|
||||
RegExpPrototypeTest,
|
||||
Set,
|
||||
|
@ -648,7 +649,7 @@
|
|||
|
||||
const defaultValues = {};
|
||||
for (const member of allMembers) {
|
||||
if ("defaultValue" in member) {
|
||||
if (ReflectHas(member, "defaultValue")) {
|
||||
const idlMemberValue = member.defaultValue;
|
||||
const imvType = typeof idlMemberValue;
|
||||
// Copy by value types can be directly assigned, copy by reference types
|
||||
|
@ -1013,13 +1014,16 @@
|
|||
for (const key in descriptors) {
|
||||
if (key === "constructor") continue;
|
||||
const descriptor = descriptors[key];
|
||||
if ("value" in descriptor && typeof descriptor.value === "function") {
|
||||
if (
|
||||
ReflectHas(descriptor, "value") &&
|
||||
typeof descriptor.value === "function"
|
||||
) {
|
||||
ObjectDefineProperty(prototype.prototype, key, {
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
} else if ("get" in descriptor) {
|
||||
} else if (ReflectHas(descriptor, "get")) {
|
||||
ObjectDefineProperty(prototype.prototype, key, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue