File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 5252 (testing " JS global console has tag Console"
5353 (let [info (externs/info externs '[console])]
5454 (is (= 'Console (:tag info)))))
55- (testing " JS global crypto has tag webCrypto.Crypto"
55+ (testing " JS global crypto has tag webCrypto.Crypto from:
56+ @type {!webCrypto.Crypto|undefined}"
5657 (let [info (externs/info externs '[crypto])]
57- (is (= 'webCrypto.Crypto (:tag info)))))))
58+ (is (= 'webCrypto.Crypto (:tag info)))))
59+ (testing " Generic return type on crypto methods returns ClojureScript relevant
60+ type info:"
61+ (testing " @return {!Promise<!ArrayBuffer>}"
62+ (let [info (externs/info externs '[webCrypto SubtleCrypto prototype encrypt])]
63+ (is (= 'Promise (:ret-tag info)))))
64+ (testing " @return {!Promise<!webCrypto.CryptoKey|!webCrypto.CryptoKeyPair>}"
65+ (let [info (externs/info externs '[webCrypto SubtleCrypto prototype deriveKey])]
66+ (is (= 'Promise (:ret-tag info)))))
67+ (testing " @return {!Int8Array|!Uint8Array|!Uint8ClampedArray|!Int16Array|!Uint16Array|!Int32Array|!Uint32Array|!BigInt64Array|!BigUint64Array}"
68+ (let [info (externs/info externs '[webCrypto SubtleCrypto prototype getRandomValues])]
69+ (is (= 'any (:ret-tag info))))))))
5870
5971(comment
6072
73+ (let [externs (::ana/externs @(env/default-compiler-env ))]
74+ (externs/info externs '[webCrypto Crypto prototype getRandomValues]))
75+
6176 (externs/parse-externs
6277 (externs/resource->source-file (io/resource " goog/object/object.js" )))
6378
You can’t perform that action at this time.
0 commit comments