mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 10:56:20 +00:00
✨ Make the obj/proxy object do not extend js/Object directly
This commit is contained in:
parent
d1d50138ed
commit
60ecb901b2
@ -425,6 +425,13 @@
|
|||||||
(let [o (get o type-symbol)]
|
(let [o (get o type-symbol)]
|
||||||
(= o t))))
|
(= o t))))
|
||||||
|
|
||||||
|
#?(:cljs
|
||||||
|
(def Proxy
|
||||||
|
(app.util.object/class
|
||||||
|
:name "Proxy"
|
||||||
|
:extends js/Object
|
||||||
|
:constructor (constantly nil))))
|
||||||
|
|
||||||
(defmacro reify
|
(defmacro reify
|
||||||
"A domain specific variation of reify that creates anonymous objects
|
"A domain specific variation of reify that creates anonymous objects
|
||||||
on demand with the ability to assign protocol implementations and
|
on demand with the ability to assign protocol implementations and
|
||||||
@ -442,7 +449,7 @@
|
|||||||
obj-sym
|
obj-sym
|
||||||
(gensym "obj-")]
|
(gensym "obj-")]
|
||||||
|
|
||||||
`(let [~obj-sym (cljs.core/js-obj)
|
`(let [~obj-sym (new Proxy)
|
||||||
~f-sym (fn [] ~type-name)]
|
~f-sym (fn [] ~type-name)]
|
||||||
(add-properties! ~obj-sym
|
(add-properties! ~obj-sym
|
||||||
{:name ~'js/Symbol.toStringTag
|
{:name ~'js/Symbol.toStringTag
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user