Skip to content
Myr

faster unstrict mode

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Michel Weststrate · committed by Michel Weststrate · parent 8e465ab · Browse files · 1 file+6 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−5 removed

  • other:+6 added−5 removed

1 file+6 added−5 removed

modified:src/utils/common.ts+6 added-5 removed
147 unmodified lines
148 return new Set(base)149 }150 if (Array.isArray(base)) return Array.prototype.slice.call(base)151152 if (!strict && isPlainObject(base)) {153 if (!getPrototypeOf(base)) {154 const obj = Object.create(null)155 return Object.assign(obj, base)152 if (!strict) {153 const proto = getPrototypeOf(base)154 if (proto !== null && isPlainObject(base)) {155 return {...base} // assumption: better inner class optimization than the assign below156 }157 return {...base}157 const obj = Object.create(proto)158 return Object.assign(obj, base)159 }160161 const descriptors = Object.getOwnPropertyDescriptors(base)162 delete descriptors[DRAFT_STATE as any]
50 unmodified lines