Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103216506
wrapNativeSuper.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 28, 06:54
Size
1 KB
Mime Type
text/x-java
Expires
Sun, Mar 2, 06:54 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
24515466
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
wrapNativeSuper.js
View Options
import
getPrototypeOf
from
"@babel/runtime/helpers/esm/getPrototypeOf"
;
import
setPrototypeOf
from
"@babel/runtime/helpers/esm/setPrototypeOf"
;
import
isNativeFunction
from
"@babel/runtime/helpers/esm/isNativeFunction"
;
import
construct
from
"@babel/runtime/helpers/esm/construct"
;
export
default
function
_wrapNativeSuper
(
Class
)
{
var
_cache
=
typeof
Map
===
"function"
?
new
Map
()
:
undefined
;
_wrapNativeSuper
=
function
_wrapNativeSuper
(
Class
)
{
if
(
Class
===
null
||
!
isNativeFunction
(
Class
))
return
Class
;
if
(
typeof
Class
!==
"function"
)
{
throw
new
TypeError
(
"Super expression must either be null or a function"
);
}
if
(
typeof
_cache
!==
"undefined"
)
{
if
(
_cache
.
has
(
Class
))
return
_cache
.
get
(
Class
);
_cache
.
set
(
Class
,
Wrapper
);
}
function
Wrapper
()
{
return
construct
(
Class
,
arguments
,
getPrototypeOf
(
this
).
constructor
);
}
Wrapper
.
prototype
=
Object
.
create
(
Class
.
prototype
,
{
constructor
:
{
value
:
Wrapper
,
enumerable
:
false
,
writable
:
true
,
configurable
:
true
}
});
return
setPrototypeOf
(
Wrapper
,
Class
);
};
return
_wrapNativeSuper
(
Class
);
}
Event Timeline
Log In to Comment