File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 11(ns cljs.proxy
22 (:refer-global :only [isNaN Proxy Symbol])
3- (:require [cljs.proxy.impl :refer [SimpleCache]]))
3+ (:require [cljs.proxy.impl :refer [SimpleCache MapIterator ]]))
44
55(defn- write-through [f]
66 (let [cache (SimpleCache. #js {} 0 )]
5050 (-count ^cljs.core/ICounted target)
5151
5252 (identical? (. Symbol -iterator) prop)
53- (.bind (unchecked-get target prop) target)
53+ (fn []
54+ (MapIterator.
55+ ((.bind (unchecked-get target prop) target)) js/__ctor))
5456
55- ( string? prop)
57+ :else
5658 (let [n (js* " +~{}" prop)]
5759 (when (and (number? n)
5860 (not (isNaN n)))
6466
6567 (identical? (. Symbol -iterator) prop) true
6668
67- ( string? prop)
69+ :else
6870 (let [n (js* " +~{}" prop)]
6971 (and (number? n)
7072 (not (isNaN n))
8082 :getOwnPropertyDescriptor
8183 (fn [target prop] desc)}
8284 map-handler #js {:get (fn [^cljs.core/ILookup target prop receiver]
83- (cond
84- (identical? (. Symbol -iterator) prop)
85- (.bind (unchecked-get target prop) target)
86-
87- :else (js/__ctor (-lookup target (cache-key-fn prop)))))
85+ (js/__ctor (-lookup target (cache-key-fn prop))))
8886
8987 :has (fn [^cljs.core/IAssociative target prop]
90- (cond
91- (identical? (. Symbol -iterator) prop) true
92- :else (-contains-key? target (cache-key-fn prop))))
88+ (-contains-key? target (cache-key-fn prop)))
9389
9490 :getPrototypeOf
9591 (fn [target] nil )
Original file line number Diff line number Diff line change 1313 (clear [this]
1414 (set! obj #js {})
1515 (set! cnt 0 )))
16+
17+ (deftype MapIterator [^:mutable iter f]
18+ Object
19+ (next [_]
20+ (let [x (.next iter)]
21+ (if-not ^boolean (. x -done)
22+ #js {:value (f (. x -value))
23+ :done false }
24+ x))))
You can’t perform that action at this time.
0 commit comments