Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9312749
redefine.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
redefine.js
View Options
var
global
=
require
(
'../internals/global'
);
var
createNonEnumerableProperty
=
require
(
'../internals/create-non-enumerable-property'
);
var
has
=
require
(
'../internals/has'
);
var
setGlobal
=
require
(
'../internals/set-global'
);
var
inspectSource
=
require
(
'../internals/inspect-source'
);
var
InternalStateModule
=
require
(
'../internals/internal-state'
);
var
getInternalState
=
InternalStateModule
.
get
;
var
enforceInternalState
=
InternalStateModule
.
enforce
;
var
TEMPLATE
=
String
(
String
).
split
(
'String'
);
(
module
.
exports
=
function
(
O
,
key
,
value
,
options
)
{
var
unsafe
=
options
?
!!
options
.
unsafe
:
false
;
var
simple
=
options
?
!!
options
.
enumerable
:
false
;
var
noTargetGet
=
options
?
!!
options
.
noTargetGet
:
false
;
var
state
;
if
(
typeof
value
==
'function'
)
{
if
(
typeof
key
==
'string'
&&
!
has
(
value
,
'name'
))
{
createNonEnumerableProperty
(
value
,
'name'
,
key
);
}
state
=
enforceInternalState
(
value
);
if
(
!
state
.
source
)
{
state
.
source
=
TEMPLATE
.
join
(
typeof
key
==
'string'
?
key
:
''
);
}
}
if
(
O
===
global
)
{
if
(
simple
)
O
[
key
]
=
value
;
else
setGlobal
(
key
,
value
);
return
;
}
else
if
(
!
unsafe
)
{
delete
O
[
key
];
}
else
if
(
!
noTargetGet
&&
O
[
key
])
{
simple
=
true
;
}
if
(
simple
)
O
[
key
]
=
value
;
else
createNonEnumerableProperty
(
O
,
key
,
value
);
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(
Function
.
prototype
,
'toString'
,
function
toString
()
{
return
typeof
this
==
'function'
&&
getInternalState
(
this
).
source
||
inspectSource
(
this
);
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 11:07 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3452098
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment