chore: mark get/set create calls pure

This commit is contained in:
Evan You 2019-12-20 11:16:46 -05:00
parent 0a4f306492
commit 755c7b581c

View File

@ -11,9 +11,9 @@ const builtInSymbols = new Set(
.filter(isSymbol) .filter(isSymbol)
) )
const get = createGetter() const get = /*#__PURE__*/ createGetter()
const readonlyGet = createGetter(true) const readonlyGet = /*#__PURE__*/ createGetter(true)
const shallowReadonlyGet = createGetter(true, true) const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true)
function createGetter(isReadonly = false, shallow = false) { function createGetter(isReadonly = false, shallow = false) {
return function get(target: object, key: string | symbol, receiver: object) { return function get(target: object, key: string | symbol, receiver: object) {
@ -40,9 +40,9 @@ function createGetter(isReadonly = false, shallow = false) {
} }
} }
const set = createSetter() const set = /*#__PURE__*/ createSetter()
const readonlySet = createSetter(true) const readonlySet = /*#__PURE__*/ createSetter(true)
const shallowReadonlySet = createSetter(true, true) const shallowReadonlySet = /*#__PURE__*/ createSetter(true, true)
function createSetter(isReadonly = false, shallow = false) { function createSetter(isReadonly = false, shallow = false) {
return function set( return function set(