Sign in
cobalt
/
cobalt
/
da5c4f09a295755b8923113581bebdc12153e6dd
/
.
/
src
/
third_party
/
mozjs-45
/
js
/
src
/
jit-test
/
tests
/
arrow-functions
/
this-5.js
blob: 98b7bf81680518f26766a2f4ff71057b6bf78600 [
file
] [
log
] [
blame
]
// Arrow functions can have primitive |this| values.
Number
.
prototype
.
foo
=
function
()
{
"use strict"
;
return
()
=>
this
;
}
for
(
var
i
=
0
;
i
<
5
;
i
++)
{
var
n
=
i
.
foo
()();
assertEq
(
typeof
n
,
"number"
);
assertEq
(
n
,
i
);
}