Sign in
webkit
/
WebKit
/
ff4cb3c2323f3937e96e08f4f6fbe6c7755f9da5
/
.
/
LayoutTests
/
js
/
script-tests
/
function-declarations-in-switch-statement.js
blob: 06cd90ec82027a55afdf6f2f1ea1b64a51b3d902 [
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'
);