summaryrefslogtreecommitdiffstats
path: root/js/src/jsfun.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-07 10:39:40 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-02-07 10:39:40 +0100
commit88db0108b14d58cf5d82ed7346f48f010feaaf0d (patch)
tree1d78ae8cd21d7d17293f66c166ca44718501d4aa /js/src/jsfun.cpp
parent8db772d2ca44ff44f32d434e7f62acba289b4155 (diff)
downloadUXP-88db0108b14d58cf5d82ed7346f48f010feaaf0d.tar
UXP-88db0108b14d58cf5d82ed7346f48f010feaaf0d.tar.gz
UXP-88db0108b14d58cf5d82ed7346f48f010feaaf0d.tar.lz
UXP-88db0108b14d58cf5d82ed7346f48f010feaaf0d.tar.xz
UXP-88db0108b14d58cf5d82ed7346f48f010feaaf0d.zip
Align `instanceof` with the final ES6 spec.
Diffstat (limited to 'js/src/jsfun.cpp')
-rw-r--r--js/src/jsfun.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp
index bcb0da80b..863871df9 100644
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -690,7 +690,7 @@ js::fun_symbolHasInstance(JSContext* cx, unsigned argc, Value* vp)
}
/*
- * ES6 (4-25-16) 7.3.19 OrdinaryHasInstance
+ * ES6 7.3.19 OrdinaryHasInstance
*/
bool
JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool* bp)
@@ -707,7 +707,7 @@ JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool*
if (obj->is<JSFunction>() && obj->isBoundFunction()) {
/* Steps 2a-b. */
obj = obj->as<JSFunction>().getBoundFunctionTarget();
- return InstanceOfOperator(cx, obj, v, bp);
+ return InstanceofOperator(cx, obj, v, bp);
}
/* Step 3. */
@@ -716,12 +716,12 @@ JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool*
return true;
}
- /* Step 4. */
+ /* Step 4-5. */
RootedValue pval(cx);
if (!GetProperty(cx, obj, obj, cx->names().prototype, &pval))
return false;
- /* Step 5. */
+ /* Step 6. */
if (pval.isPrimitive()) {
/*
* Throw a runtime error if instanceof is called on a function that
@@ -732,7 +732,7 @@ JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool*
return false;
}
- /* Step 6. */
+ /* Step 7. */
RootedObject pobj(cx, &pval.toObject());
bool isDelegate;
if (!IsDelegate(cx, pobj, v, &isDelegate))