mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1276082 - Get self-hosted function name only from global functions. r=h4writer
This commit is contained in:
parent
028104646a
commit
5bad0908f5
5
js/src/jit-test/tests/auto-regress/bug1276082.js
Normal file
5
js/src/jit-test/tests/auto-regress/bug1276082.js
Normal file
@ -0,0 +1,5 @@
|
||||
function f() {
|
||||
(function() {}).bind()(/x/);
|
||||
}
|
||||
f();
|
||||
f();
|
@ -3185,7 +3185,10 @@ js::IsSelfHostedFunctionWithName(JSFunction* fun, JSAtom* name)
|
||||
JSAtom*
|
||||
js::GetSelfHostedFunctionName(JSFunction* fun)
|
||||
{
|
||||
return &fun->getExtendedSlot(LAZY_FUNCTION_NAME_SLOT).toString()->asAtom();
|
||||
Value name = fun->getExtendedSlot(LAZY_FUNCTION_NAME_SLOT);
|
||||
if (!name.isString())
|
||||
return nullptr;
|
||||
return &name.toString()->asAtom();
|
||||
}
|
||||
|
||||
static_assert(JSString::MAX_LENGTH <= INT32_MAX,
|
||||
|
Loading…
Reference in New Issue
Block a user