On 2014/08/12 13:44:18, Yang wrote:
On 2014/08/12 11:53:24, Yang wrote:
> On 2014/08/12 11:34:12, aandrey wrote:
> > > How about checking against the sloppy_arguments_map or the
> > strict_arguments_map?
> >
> > But this would catch only the Arguments object that is currently bound to
> > native_context, right?
>
> Hm. You are right.

You can use JSObject::GetCreationContext to get the context from which you can
get those maps.

I tried and this doesn't work. The following fails:

v8::Handle<Value> arguments_object = CompileRun("var out = 0; (function(){ out
= arguments; out._dummy = 42; })(1,2); out;");
  CHECK(arguments_object->IsArgumentsObject());

Why are you against HasSpecificClassOf("Arguments")?
- actually this is exactly what I need, otherwise I would have used
JSObject::class_name() directly if it was exposed
- in this way implemented many v8::Value::Is* checkers
- in this way implemented v8::Object::ObjectProtoToString() and I do want to be
consistent with it
- macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments');

Any other method seems to be inconsistent with the above.


https://codereview.chromium.org/460333002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to