Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issues/1971 caller is undefined,but it's not undefined in broswer. #1980

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Jint/Engine.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Diagnostics;
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Jint.Native;
Expand Down Expand Up @@ -1057,6 +1057,8 @@ private void GlobalDeclarationInstantiation(
var arguments = canInitializeParametersOnDeclaration ? argumentsList : null;
env.InitializeParameters(parameterNames, hasDuplicates, arguments);

function.SetProperty(KnownKeys.Caller, new PropertyDescriptor(this.GetExecutionContext(1).Function ?? ScriptFunction.Undefined, PropertyFlag.Configurable));

JsArguments? ao = null;
if (configuration.ArgumentsObjectNeeded || _isDebugMode)
{
Expand Down
Loading