Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9348680
es.string.from-code-point.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
es.string.from-code-point.js
View Options
var
$
=
require
(
'../internals/export'
);
var
uncurryThis
=
require
(
'../internals/function-uncurry-this'
);
var
toAbsoluteIndex
=
require
(
'../internals/to-absolute-index'
);
var
$RangeError
=
RangeError
;
var
fromCharCode
=
String
.
fromCharCode
;
// eslint-disable-next-line es-x/no-string-fromcodepoint -- required for testing
var
$fromCodePoint
=
String
.
fromCodePoint
;
var
join
=
uncurryThis
([].
join
);
// length should be 1, old FF problem
var
INCORRECT_LENGTH
=
!!
$fromCodePoint
&&
$fromCodePoint
.
length
!=
1
;
// `String.fromCodePoint` method
// https://tc39.es/ecma262/#sec-string.fromcodepoint
$
({
target
:
'String'
,
stat
:
true
,
arity
:
1
,
forced
:
INCORRECT_LENGTH
},
{
// eslint-disable-next-line no-unused-vars -- required for `.length`
fromCodePoint
:
function
fromCodePoint
(
x
)
{
var
elements
=
[];
var
length
=
arguments
.
length
;
var
i
=
0
;
var
code
;
while
(
length
>
i
)
{
code
=
+
arguments
[
i
++
];
if
(
toAbsoluteIndex
(
code
,
0x10FFFF
)
!==
code
)
throw
$RangeError
(
code
+
' is not a valid code point'
);
elements
[
i
]
=
code
<
0x10000
?
fromCharCode
(
code
)
:
fromCharCode
(((
code
-=
0x10000
)
>>
10
)
+
0xD800
,
code
%
0x400
+
0xDC00
);
}
return
join
(
elements
,
''
);
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 4 2025, 6:43 PM (5 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3345793
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment