Skip to content

Commit

Permalink
Rename thisObj to thisObject and args as arguments in parameter names (
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Jul 30, 2023
1 parent ac1cec8 commit 2ec677c
Show file tree
Hide file tree
Showing 40 changed files with 686 additions and 693 deletions.
11 changes: 4 additions & 7 deletions Jint.Tests/Runtime/Domain/UuidPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ private UuidPrototype(Engine engine) : base(engine)
{
}

private UuidInstance EnsureUuidInstance(JsValue thisObj)
private UuidInstance EnsureUuidInstance(JsValue thisObject)
{
return thisObj.TryCast<UuidInstance>(value =>
{
throw new JavaScriptException(Engine.Realm.Intrinsics.TypeError, "Invalid Uuid");
});
return thisObject.TryCast<UuidInstance>(value => throw new JavaScriptException(Engine.Realm.Intrinsics.TypeError, "Invalid Uuid"));
}

private JsValue ToGuidString(JsValue thisObj, JsValue[] arguments) => EnsureUuidInstance(thisObj).PrimitiveValue.ToString();
private JsValue ToGuidString(JsValue thisObject, JsValue[] arguments) => EnsureUuidInstance(thisObject).PrimitiveValue.ToString();

private JsValue ValueOf(JsValue thisObj, JsValue[] arguments) => EnsureUuidInstance(thisObj).PrimitiveValue;
private JsValue ValueOf(JsValue thisObject, JsValue[] arguments) => EnsureUuidInstance(thisObject).PrimitiveValue;

public static UuidPrototype CreatePrototypeObject(Engine engine, UuidConstructor ctor)
{
Expand Down
24 changes: 12 additions & 12 deletions Jint/Native/Array/ArrayConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected override void Initialize()
/// <summary>
/// https://tc39.es/ecma262/#sec-array.from
/// </summary>
private JsValue From(JsValue thisObj, JsValue[] arguments)
private JsValue From(JsValue thisObject, JsValue[] arguments)
{
var items = arguments.At(0);
var mapFunction = arguments.At(1);
Expand All @@ -65,9 +65,9 @@ private JsValue From(JsValue thisObj, JsValue[] arguments)
if (usingIterator is not null)
{
ObjectInstance instance;
if (!ReferenceEquals(this, thisObj) && thisObj is IConstructor constructor)
if (!ReferenceEquals(this, thisObject) && thisObject is IConstructor constructor)
{
instance = constructor.Construct(System.Array.Empty<JsValue>(), thisObj);
instance = constructor.Construct(System.Array.Empty<JsValue>(), thisObject);
}
else
{
Expand All @@ -86,7 +86,7 @@ private JsValue From(JsValue thisObj, JsValue[] arguments)
return ConstructArrayFromIEnumerable(enumerable);
}

return ConstructArrayFromArrayLike(thisObj, objectInstance, callable, thisArg);
return ConstructArrayFromArrayLike(thisObject, objectInstance, callable, thisArg);
}

private ObjectInstance ConstructArrayFromArrayLike(
Expand Down Expand Up @@ -160,15 +160,15 @@ public ArrayProtocol(
_callable = callable;
}

protected override void ProcessItem(JsValue[] args, JsValue currentValue)
protected override void ProcessItem(JsValue[] arguments, JsValue currentValue)
{
_index++;
JsValue jsValue;
if (!ReferenceEquals(_callable, null))
{
args[0] = currentValue;
args[1] = _index;
jsValue = _callable.Call(_thisArg, args);
arguments[0] = currentValue;
arguments[1] = _index;
jsValue = _callable.Call(_thisArg, arguments);
}
else
{
Expand All @@ -184,13 +184,13 @@ protected override void IterationEnd()
}
}

private JsValue Of(JsValue thisObj, JsValue[] arguments)
private JsValue Of(JsValue thisObject, JsValue[] arguments)
{
var len = arguments.Length;
ObjectInstance a;
if (thisObj.IsConstructor)
if (thisObject.IsConstructor)
{
a = ((IConstructor) thisObj).Construct(new JsValue[] { len }, thisObj);
a = ((IConstructor) thisObject).Construct(new JsValue[] { len }, thisObject);
}
else
{
Expand Down Expand Up @@ -227,7 +227,7 @@ private static JsValue Species(JsValue thisObject, JsValue[] arguments)
return thisObject;
}

private static JsValue IsArray(JsValue thisObj, JsValue[] arguments)
private static JsValue IsArray(JsValue thisObject, JsValue[] arguments)
{
var o = arguments.At(0);

Expand Down
Loading

0 comments on commit 2ec677c

Please sign in to comment.