Sign in
webkit
/
WebKit
/
247170fdc0cd5e15ebfa4e25ab82d1a4514f1943
/
.
/
LayoutTests
/
js
/
script-tests
/
function-declarations-in-switch-statement.js
blob: f3c4ba206507971f5803b51416768400f4653fef [
file
] [
log
] [
blame
]
function
t
(
n
)
{
switch
(
n
)
{
case
1
:
function
f
()
{
return
10
;
}
break
;
case
2
:
function
f
()
{
return
20
;
}
break
;
}
try
{
return
f
();
}
catch
(
e
)
{
return
-
1
;
}
}
shouldBe
(
t
(
1
),
'20'
);
shouldBe
(
t
(
2
),
'20'
);
shouldBe
(
t
(
3
),
'-1'
);