Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsexplain
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verified Software
jsexplain
Commits
7f272e28
Commit
7f272e28
authored
8 years ago
by
charguer
Committed by
Thomas Wood
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
coercions_display_erge
parent
4e519d2e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generator/js_of_ast.ml
+13
-9
13 additions, 9 deletions
generator/js_of_ast.ml
with
13 additions
and
9 deletions
generator/js_of_ast.ml
+
13
−
9
View file @
7f272e28
...
...
@@ -603,7 +603,8 @@ let apply_dest loc ctx dest sbody =
exception
Not_good_for_dest_inline
let
reject_inline
dest
=
if
dest
=
Dest_inline
then
raise
Not_good_for_dest_inline
if
dest
=
Dest_inline
&&
is_mode_not_pseudo
()
then
raise
Not_good_for_dest_inline
...
...
@@ -708,13 +709,17 @@ and js_of_expression_wrapped ctx e = (* dest = Dest_return *)
ppf_lambda_wrap
(
js_of_expression
ctx
Dest_return
e
)
and
js_of_expression_naming_argument_if_non_variable
ctx
obj
name_prefix
=
match
obj
.
exp_desc
with
|
Texp_ident
(
path
,
ident
,
_
)
->
""
,
(
js_of_path_longident
path
ident
)
|
_
->
(* generate var id = sexp; *)
let
id
=
id_fresh
name_prefix
in
let
sintro
=
js_of_expression
ctx
(
Dest_assign
id
)
obj
in
(
sintro
^
"@,"
)
,
id
if
is_mode_pseudo
()
then
begin
js_of_expression
ctx
Dest_inline
obj
end
else
begin
match
obj
.
exp_desc
with
|
Texp_ident
(
path
,
ident
,
_
)
->
""
,
(
js_of_path_longident
path
ident
)
|
_
->
(* generate var id = sexp; *)
let
id
=
id_fresh
name_prefix
in
let
sintro
=
js_of_expression
ctx
(
Dest_assign
id
)
obj
in
(
sintro
^
"@,"
)
,
id
end
and
js_of_expression
ctx
dest
e
=
let
inline_of_wrap
=
js_of_expression_inline_or_wrap
ctx
in
(* shorthand *)
...
...
@@ -864,7 +869,6 @@ and js_of_expression ctx dest e =
let
arg_is_constant
=
exp_type_is_constant
obj
in
generate_logged_match
loc
ctx
sintro
sarg
sbranches
arg_is_constant
|
Texp_tuple
(
tl
)
->
let
sexp
=
ppf_tuple
@@
show_list_f
(
fun
exp
->
inline_of_wrap
exp
)
", "
tl
in
apply_dest'
ctx
dest
sexp
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment