Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
73
Issues
73
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
a86e4dbe
Commit
a86e4dbe
authored
Sep 09, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add-jsTraceVal' into 'master'
Add jsTraceVal See merge request
!308
parents
913bc508
a88d041e
Pipeline
#29288
passed with stage
in 5 minutes and 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
Libraries/iTasks/UI/JavaScript.dcl
Libraries/iTasks/UI/JavaScript.dcl
+9
-0
Libraries/iTasks/UI/JavaScript.icl
Libraries/iTasks/UI/JavaScript.icl
+5
-2
No files found.
Libraries/iTasks/UI/JavaScript.dcl
View file @
a86e4dbe
...
...
@@ -230,7 +230,16 @@ addJSFromUrl :: !String !(Maybe JSFun) !*JSWorld -> *JSWorld
/**
* A simple wrapper around JavaScript's `console.log`.
* Use {{`jsTraceVal`}} to trace JavaScript values.
* @param The value to log.
* @param The value to return.
*/
jsTrace
::
!
a
.
b
->
.
b
|
toString
a
/**
* A simple wrapper around JavaScript's `console.log`.
* Use {{`jsTrace`}} to trace Clean values.
* @param The value to log.
* @param The value to return.
*/
jsTraceVal
::
!
JSVal
.
a
->
.
a
Libraries/iTasks/UI/JavaScript.icl
View file @
a86e4dbe
...
...
@@ -615,9 +615,12 @@ where
}
jsTrace
::
!
a
.
b
->
.
b
|
toString
a
jsTrace
s
x
=
case
eval_js
(
js_val_to_string
(
JSCall
(
JSVar
"console.log"
)
{
JSString
(
toString
s
)}))
of
jsTrace
s
x
=
jsTraceVal
(
JSString
(
toString
s
))
x
jsTraceVal
::
!
JSVal
.
a
->
.
a
jsTraceVal
v
x
=
case
eval_js
(
js_val_to_string
(
JSCall
(
JSVar
"console.log"
)
{
v
}))
of
True
->
x
False
->
abort_with_node
s
// just in case it is a JSVal
False
->
abort_with_node
v
set_js
::
!*
String
!*
String
->
Bool
set_js
var
val
=
code {
...
...
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