Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
parenscript
parenscript
Commits
ca62a581
Commit
ca62a581
authored
Feb 03, 2015
by
Boris Smilga
Browse files
Accessors in object literals conditionally available for JS target version ≥1.8.5.
parent
eec22d29
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/non-cl.lisp
View file @
ca62a581
...
...
@@ -45,9 +45,11 @@
(
define-expression-operator
create
(
&rest
arrows
)
`
(
ps-js:object
,@
(
loop
for
(
key
val-expr
)
on
arrows
by
#'
cddr
,@
(
loop
with
allow-accessors
=
(
vstring>=
*js-target-version*
"1.8.5"
)
for
(
key
val-expr
)
on
arrows
by
#'
cddr
for
(
accessor
.
accessor-args
)
=
(
when
(
and
(
consp
key
)
(
when
(
and
allow-accessors
(
consp
key
)
(
symbolp
(
first
key
))
(
symbolp
(
second
key
)))
(
case
(
first
key
)
...
...
@@ -71,10 +73,12 @@
(
null
(
third
key
)))
(
symbol-to-js-string
(
second
key
)))
(
t
(
error
"Slot key ~s is not one of symbol, string, ~
number, or accessor spec."
key
)))
(
error
"Slot key ~s is not one of ~
~{~a~#[~;, or ~:;, ~]~}."
key
`
(
"symbol"
"string"
"number"
,@
(
when
allow-accessors
'
(
"accessor spec"
))))))
(
compile-expression
val-expr
))))))
(
define-expression-operator
%js-getprop
(
obj
slot
)
...
...
t/output-tests.lisp
View file @
ca62a581
...
...
@@ -164,7 +164,8 @@
}, set x(v) {
return x = v;
} };
};"
)
};"
:js-target-version
"1.8.5"
)
(
test-ps-js
object-method-apply-1
(
apply
(
@
an-object
foo
)
nil
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment