diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-07 10:39:40 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-07 10:39:40 +0100 |
commit | 88db0108b14d58cf5d82ed7346f48f010feaaf0d (patch) | |
tree | 1d78ae8cd21d7d17293f66c166ca44718501d4aa /js/src/jsfun.cpp | |
parent | 8db772d2ca44ff44f32d434e7f62acba289b4155 (diff) | |
download | UXP-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.cpp | 10 |
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)) |