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
This commit is contained in:
Ted Campbell 2018-11-20 10:53:32 +00:00
Родитель 4bd38939c8
Коммит 91e0804ed8
3 изменённых файлов: 29 добавлений и 16 удалений

Просмотреть файл

@ -164,9 +164,9 @@ ScriptedProxyHandler::handlerObject(const JSObject* proxy)
return proxy->as<ProxyObject>().reservedSlot(ScriptedProxyHandler::HANDLER_EXTRA).toObjectOrNull(); return proxy->as<ProxyObject>().reservedSlot(ScriptedProxyHandler::HANDLER_EXTRA).toObjectOrNull();
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.9 GetMethod, // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// reimplemented for proxy handler trap-getting to produce better error // 7.3.9 GetMethod, reimplemented for proxy handler trap-getting to produce
// messages. // better error messages.
static bool static bool
GetProxyTrap(JSContext* cx, HandleObject handler, HandlePropertyName name, MutableHandleValue func) GetProxyTrap(JSContext* cx, HandleObject handler, HandlePropertyName name, MutableHandleValue func)
{ {
@ -199,7 +199,8 @@ GetProxyTrap(JSContext* cx, HandleObject handler, HandlePropertyName name, Mutab
return true; return true;
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.1 Proxy.[[GetPrototypeOf]]. // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.1 Proxy.[[GetPrototypeOf]].
bool bool
ScriptedProxyHandler::getPrototype(JSContext* cx, HandleObject proxy, ScriptedProxyHandler::getPrototype(JSContext* cx, HandleObject proxy,
MutableHandleObject protop) const MutableHandleObject protop) const
@ -277,7 +278,8 @@ ScriptedProxyHandler::getPrototype(JSContext* cx, HandleObject proxy,
return true; return true;
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.2 Proxy.[[SetPrototypeOf]]. // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.2 Proxy.[[SetPrototypeOf]].
bool bool
ScriptedProxyHandler::setPrototype(JSContext* cx, HandleObject proxy, HandleObject proto, ScriptedProxyHandler::setPrototype(JSContext* cx, HandleObject proxy, HandleObject proto,
ObjectOpResult& result) const ObjectOpResult& result) const
@ -376,7 +378,8 @@ ScriptedProxyHandler::setImmutablePrototype(JSContext* cx, HandleObject proxy,
return SetImmutablePrototype(cx, target, succeeded); return SetImmutablePrototype(cx, target, succeeded);
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.4 Proxy.[[PreventExtensions]]() // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.4 Proxy.[[PreventExtensions]]()
bool bool
ScriptedProxyHandler::preventExtensions(JSContext* cx, HandleObject proxy, ScriptedProxyHandler::preventExtensions(JSContext* cx, HandleObject proxy,
ObjectOpResult& result) const ObjectOpResult& result) const
@ -437,7 +440,8 @@ ScriptedProxyHandler::preventExtensions(JSContext* cx, HandleObject proxy,
return result.fail(JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE); 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 bool
ScriptedProxyHandler::isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) const ScriptedProxyHandler::isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) const
{ {
@ -492,7 +496,8 @@ ScriptedProxyHandler::isExtensible(JSContext* cx, HandleObject proxy, bool* exte
return true; return true;
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.5 Proxy.[[GetOwnProperty]](P) // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.5 Proxy.[[GetOwnProperty]](P)
bool bool
ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id, ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
MutableHandle<PropertyDescriptor> desc) const MutableHandle<PropertyDescriptor> desc) const
@ -614,7 +619,8 @@ ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy
return true; return true;
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.6 Proxy.[[DefineOwnProperty]](P, Desc) // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.6 Proxy.[[DefineOwnProperty]](P, Desc)
bool bool
ScriptedProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id, ScriptedProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
Handle<PropertyDescriptor> desc, ObjectOpResult& result) const Handle<PropertyDescriptor> desc, ObjectOpResult& result) const
@ -914,7 +920,8 @@ ScriptedProxyHandler::ownPropertyKeys(JSContext* cx, HandleObject proxy, AutoIdV
return props.appendAll(trapResult); return props.appendAll(trapResult);
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.10 Proxy.[[Delete]](P) // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.10 Proxy.[[Delete]](P)
bool bool
ScriptedProxyHandler::delete_(JSContext* cx, HandleObject proxy, HandleId id, ScriptedProxyHandler::delete_(JSContext* cx, HandleObject proxy, HandleId id,
ObjectOpResult& result) const ObjectOpResult& result) const
@ -984,7 +991,8 @@ ScriptedProxyHandler::delete_(JSContext* cx, HandleObject proxy, HandleId id,
return result.succeed(); return result.succeed();
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.7 Proxy.[[HasProperty]](P) // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.7 Proxy.[[HasProperty]](P)
bool bool
ScriptedProxyHandler::has(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const 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; return true;
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.8 Proxy.[[GetP]](P, Receiver) // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.8 Proxy.[[GetP]](P, Receiver)
bool bool
ScriptedProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receiver, HandleId id, ScriptedProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receiver, HandleId id,
MutableHandleValue vp) const MutableHandleValue vp) const
@ -1138,7 +1147,8 @@ ScriptedProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receive
return true; 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 bool
ScriptedProxyHandler::set(JSContext* cx, HandleObject proxy, HandleId id, HandleValue v, ScriptedProxyHandler::set(JSContext* cx, HandleObject proxy, HandleId id, HandleValue v,
HandleValue receiver, ObjectOpResult& result) const HandleValue receiver, ObjectOpResult& result) const
@ -1428,7 +1438,8 @@ IsRevokedScriptedProxy(JSObject* obj)
return obj && IsScriptedProxy(obj) && !obj->as<ProxyObject>().target(); return obj && IsScriptedProxy(obj) && !obj->as<ProxyObject>().target();
} }
// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.14 ProxyCreate. // ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 9.5.14 ProxyCreate.
static bool static bool
ProxyCreate(JSContext* cx, CallArgs& args, const char* callerName) ProxyCreate(JSContext* cx, CallArgs& args, const char* callerName)
{ {

Просмотреть файл

@ -620,7 +620,8 @@ js::CallFromStack(JSContext* cx, const CallArgs& args)
return InternalCall(cx, static_cast<const AnyInvokeArgs&>(args)); return InternalCall(cx, static_cast<const AnyInvokeArgs&>(args));
} }
// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.12 Call. // ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
// 7.3.12 Call.
bool bool
js::Call(JSContext* cx, HandleValue fval, HandleValue thisv, const AnyInvokeArgs& args, js::Call(JSContext* cx, HandleValue fval, HandleValue thisv, const AnyInvokeArgs& args,
MutableHandleValue rval) MutableHandleValue rval)

Просмотреть файл

@ -68,7 +68,8 @@ CallGetter(JSContext* cx, HandleValue thisv, HandleValue getter, MutableHandleVa
extern bool extern bool
CallSetter(JSContext* cx, HandleValue thisv, HandleValue setter, HandleValue rval); 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 // All parameters are required, hopefully forcing callers to be careful not to
// (say) blindly pass callee as |newTarget| when a different value should have // (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. // been passed. Behavior is unspecified if any element of |args| isn't initialized.