Skip to content

Commit e1c2252

Browse files
committed
#167 - after merge
1 parent 4c3ce4e commit e1c2252

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
<None Update="Samples\defaultarray.js">
4343
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4444
</None>
45+
<None Update="Samples\defaultparams.js">
46+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
47+
</None>
4548
<None Update="Samples\equals.js">
4649
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4750
</None>
@@ -57,12 +60,18 @@
5760
<None Update="Samples\gcd.js">
5861
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5962
</None>
63+
<None Update="Samples\jump.js">
64+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
65+
</None>
6066
<None Update="Samples\lcm.js">
6167
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
6268
</None>
6369
<None Update="Samples\linkedlist.js">
6470
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
6571
</None>
72+
<None Update="Samples\nullable.js">
73+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
74+
</None>
6675
<None Update="Samples\objeditread.js">
6776
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
6877
</None>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
function g(a:number, b = 0){
2+
>>> "g(number, number)"
3+
>>> a
4+
>>> b
5+
}
6+
7+
g(1)
8+
g(1,2)
9+
10+
function f(){
11+
>>>"f()"
12+
}
13+
function f(a = 0){
14+
>>> "f(number)"
15+
>>> a
16+
}
17+
function f(a = 0, b = 1){
18+
>>> "f(number, number)"
19+
>>> a
20+
>>> b
21+
}
22+
23+
f()
24+
f(1)
25+
f(1,2)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let i = 0
2+
while (i < 10) {
3+
if (i % 2 == 0)
4+
continue
5+
if (i == 7)
6+
break
7+
i = i + 1
8+
}
9+
>>> i
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function indexOrNull(arr:number[], val:number): number?{
2+
const n = ~arr
3+
let i = 0
4+
while(i < n){
5+
if (arr[i] == val)
6+
return i
7+
i = i + 1
8+
}
9+
return null
10+
}
11+
12+
>>> indexOrNull([1,2,3], 4)
13+
>>> indexOrNull([1,2,3], 2)

0 commit comments

Comments
 (0)