From 91e0804ed82f7c1ffd63ab278938a0e28702ecb6 Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Tue, 20 Nov 2018 10:53:32 +0000 Subject: [PATCH] Bug 1508255 - Wrap ES Spec reference comments r=jorendorff Depends on D12389 Differential Revision: https://phabricator.services.mozilla.com/D12390 --HG-- extra : moz-landing-system : lando --- js/src/proxy/ScriptedProxyHandler.cpp | 39 +++++++++++++++++---------- js/src/vm/Interpreter.cpp | 3 ++- js/src/vm/Interpreter.h | 3 ++- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/js/src/proxy/ScriptedProxyHandler.cpp b/js/src/proxy/ScriptedProxyHandler.cpp index ca67f42884e8..2ec55c1edec1 100644 --- a/js/src/proxy/ScriptedProxyHandler.cpp +++ b/js/src/proxy/ScriptedProxyHandler.cpp @@ -164,9 +164,9 @@ ScriptedProxyHandler::handlerObject(const JSObject* proxy) return proxy->as().reservedSlot(ScriptedProxyHandler::HANDLER_EXTRA).toObjectOrNull(); } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.9 GetMethod, -// reimplemented for proxy handler trap-getting to produce better error -// messages. +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 7.3.9 GetMethod, reimplemented for proxy handler trap-getting to produce +// better error messages. static bool GetProxyTrap(JSContext* cx, HandleObject handler, HandlePropertyName name, MutableHandleValue func) { @@ -199,7 +199,8 @@ GetProxyTrap(JSContext* cx, HandleObject handler, HandlePropertyName name, Mutab return true; } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.1 Proxy.[[GetPrototypeOf]]. +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.1 Proxy.[[GetPrototypeOf]]. bool ScriptedProxyHandler::getPrototype(JSContext* cx, HandleObject proxy, MutableHandleObject protop) const @@ -277,7 +278,8 @@ ScriptedProxyHandler::getPrototype(JSContext* cx, HandleObject proxy, return true; } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.2 Proxy.[[SetPrototypeOf]]. +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.2 Proxy.[[SetPrototypeOf]]. bool ScriptedProxyHandler::setPrototype(JSContext* cx, HandleObject proxy, HandleObject proto, ObjectOpResult& result) const @@ -376,7 +378,8 @@ ScriptedProxyHandler::setImmutablePrototype(JSContext* cx, HandleObject proxy, return SetImmutablePrototype(cx, target, succeeded); } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.4 Proxy.[[PreventExtensions]]() +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.4 Proxy.[[PreventExtensions]]() bool ScriptedProxyHandler::preventExtensions(JSContext* cx, HandleObject proxy, ObjectOpResult& result) const @@ -437,7 +440,8 @@ ScriptedProxyHandler::preventExtensions(JSContext* cx, HandleObject proxy, return result.fail(JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE); } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.3 Proxy.[[IsExtensible]]() +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.3 Proxy.[[IsExtensible]]() bool ScriptedProxyHandler::isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) const { @@ -492,7 +496,8 @@ ScriptedProxyHandler::isExtensible(JSContext* cx, HandleObject proxy, bool* exte return true; } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.5 Proxy.[[GetOwnProperty]](P) +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.5 Proxy.[[GetOwnProperty]](P) bool ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id, MutableHandle desc) const @@ -614,7 +619,8 @@ ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy return true; } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.6 Proxy.[[DefineOwnProperty]](P, Desc) +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.6 Proxy.[[DefineOwnProperty]](P, Desc) bool ScriptedProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id, Handle desc, ObjectOpResult& result) const @@ -914,7 +920,8 @@ ScriptedProxyHandler::ownPropertyKeys(JSContext* cx, HandleObject proxy, AutoIdV return props.appendAll(trapResult); } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.10 Proxy.[[Delete]](P) +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.10 Proxy.[[Delete]](P) bool ScriptedProxyHandler::delete_(JSContext* cx, HandleObject proxy, HandleId id, ObjectOpResult& result) const @@ -984,7 +991,8 @@ ScriptedProxyHandler::delete_(JSContext* cx, HandleObject proxy, HandleId id, return result.succeed(); } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.7 Proxy.[[HasProperty]](P) +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.7 Proxy.[[HasProperty]](P) bool ScriptedProxyHandler::has(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const { @@ -1057,7 +1065,8 @@ ScriptedProxyHandler::has(JSContext* cx, HandleObject proxy, HandleId id, bool* return true; } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.8 Proxy.[[GetP]](P, Receiver) +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.8 Proxy.[[GetP]](P, Receiver) bool ScriptedProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receiver, HandleId id, MutableHandleValue vp) const @@ -1138,7 +1147,8 @@ ScriptedProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receive return true; } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.9 Proxy.[[Set]](P, V, Receiver) +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.9 Proxy.[[Set]](P, V, Receiver) bool ScriptedProxyHandler::set(JSContext* cx, HandleObject proxy, HandleId id, HandleValue v, HandleValue receiver, ObjectOpResult& result) const @@ -1428,7 +1438,8 @@ IsRevokedScriptedProxy(JSObject* obj) return obj && IsScriptedProxy(obj) && !obj->as().target(); } -// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.14 ProxyCreate. +// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 9.5.14 ProxyCreate. static bool ProxyCreate(JSContext* cx, CallArgs& args, const char* callerName) { diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index d70d51e1f638..579645df7fd2 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -620,7 +620,8 @@ js::CallFromStack(JSContext* cx, const CallArgs& args) return InternalCall(cx, static_cast(args)); } -// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.12 Call. +// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 7.3.12 Call. bool js::Call(JSContext* cx, HandleValue fval, HandleValue thisv, const AnyInvokeArgs& args, MutableHandleValue rval) diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h index 9bd4485c6558..0ce115f7af2c 100644 --- a/js/src/vm/Interpreter.h +++ b/js/src/vm/Interpreter.h @@ -68,7 +68,8 @@ CallGetter(JSContext* cx, HandleValue thisv, HandleValue getter, MutableHandleVa extern bool CallSetter(JSContext* cx, HandleValue thisv, HandleValue setter, HandleValue rval); -// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.12 Call(F, V, argumentsList). +// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 +// 7.3.12 Call(F, V, argumentsList). // All parameters are required, hopefully forcing callers to be careful not to // (say) blindly pass callee as |newTarget| when a different value should have // been passed. Behavior is unspecified if any element of |args| isn't initialized.