-
Notifications
You must be signed in to change notification settings - Fork 0
/
Boolean.cljs
74 lines (51 loc) · 1.7 KB
/
Boolean.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
(ns js.Boolean
"The Boolean object is an object wrapper for a boolean value."
(:refer-clojure :exclude []))
(defn to-source
"Method.
The toSource() method returns a string representing the source
of the object.
`booleanObj.toSource()
Boolean.toSource()`
See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/toSource`"
[this & args]
(-> this .-toSource (.apply this (clj->js args))))
(defn to-string
"Method.
The toString() method returns a string representing the specified
object.
`bool.toString()`
See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/toString`"
[this ]
(-> this (.toString)))
(defn value-of
"Method.
The valueOf() method returns the primitive value of a `js.Boolean`
`bool.valueOf()`
See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/valueOf`"
[this ]
(-> this (.valueOf)))
(defn length
"Property.
Length property whose value is 1."
[this]
(-> this (.-length)))
(defn set-length!
"Property.
Length property whose value is 1."
[this val]
(aset this "length" val))
(defn prototype
"Property.
The Boolean.prototype property represents the prototype for the
constructor.
See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/prototype`"
[this]
(-> this (.-prototype)))
(defn set-prototype!
"Property.
The Boolean.prototype property represents the prototype for the
constructor.
See also: `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean/prototype`"
[this val]
(aset this "prototype" val))