Skip to content

Commit

Permalink
Rename ProxyInstance to JsProxy (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Jul 31, 2023
1 parent 0b1ed1b commit 5689052
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Jint/Native/Function/FunctionInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ internal Realm GetFunctionRealm(JsValue obj)
return GetFunctionRealm(bindFunctionInstance.BoundTargetFunction);
}

if (obj is ProxyInstance proxyInstance)
if (obj is JsProxy proxyInstance)
{
if (proxyInstance._handler is null)
{
Expand Down
2 changes: 1 addition & 1 deletion Jint/Native/Json/JsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private static bool CanSerializesAsArray(ObjectInstance value)
return true;
}

if (value is ProxyInstance proxyInstance && CanSerializesAsArray(proxyInstance._target))
if (value is JsProxy proxyInstance && CanSerializesAsArray(proxyInstance._target))
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Jint/Native/Object/ObjectPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ internal JsValue ToObjectString(JsValue thisObject, JsValue[] arguments)
}
else
{
tag = (o is ProxyInstance ? ObjectClass.Object : o.Class).ToString();
tag = (o is JsProxy ? ObjectClass.Object : o.Class).ToString();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Jint.Native.Proxy
{
internal sealed class ProxyInstance : ObjectInstance, IConstructor, ICallable
internal sealed class JsProxy : ObjectInstance, IConstructor, ICallable
{
internal ObjectInstance _target;
internal ObjectInstance? _handler;
Expand All @@ -27,7 +27,7 @@ internal sealed class ProxyInstance : ObjectInstance, IConstructor, ICallable
private static readonly JsString KeyFunctionRevoke = new JsString("revoke");
private static readonly JsString KeyIsArray = new JsString("isArray");

public ProxyInstance(
public JsProxy(
Engine engine,
ObjectInstance target,
ObjectInstance handler)
Expand Down
6 changes: 3 additions & 3 deletions Jint/Native/Proxy/ProxyConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
/// <summary>
/// https://tc39.es/ecma262/#sec-proxy-target-handler
/// </summary>
public ProxyInstance Construct(JsValue target, JsValue handler)
public JsProxy Construct(JsValue target, JsValue handler)
{
return ProxyCreate(target, handler);
}
Expand Down Expand Up @@ -78,7 +78,7 @@ JsValue Revoke(JsValue thisObject, JsValue[] arguments)
/// <summary>
/// https://tc39.es/ecma262/#sec-proxycreate
/// </summary>
private ProxyInstance ProxyCreate(JsValue target, JsValue handler)
private JsProxy ProxyCreate(JsValue target, JsValue handler)
{
if (target is not ObjectInstance targetObject)
{
Expand All @@ -92,7 +92,7 @@ private ProxyInstance ProxyCreate(JsValue target, JsValue handler)
return null;
}

var p = new ProxyInstance(Engine, targetObject, targetHandler);
var p = new JsProxy(Engine, targetObject, targetHandler);
return p;
}
}
Expand Down

0 comments on commit 5689052

Please sign in to comment.