We got a bunch of call sites to Symbol::name that does not check for
private,
for example in objects-printer.cc, log-utils.cc, log.cc, etc. It would
return
the box in case of a private (not sure whether that could happen at all).
I suggest creating a Symbol::Name() method that encapsulates the
private-check
and does the correct thing to return a string, and use that instead of
Symbol::name() in places where we do not care about the distinction, and
make
Symbol::name() a protected method so that only Private::name can get access
to
the box.
https://codereview.chromium.org/48923002/diff/70001/src/api.cc
File src/api.cc (right):
https://codereview.chromium.org/48923002/diff/70001/src/api.cc#newcode6201
src/api.cc:6201: return Utils::ToLocal(result);
I think you could unify those two New functions by having a default
argument for data like NULL or "\0".
https://codereview.chromium.org/48923002/diff/70001/src/objects-inl.h
File src/objects-inl.h (right):
https://codereview.chromium.org/48923002/diff/70001/src/objects-inl.h#newcode2703
src/objects-inl.h:2703: return Box::cast(Symbol::name())->value();
could we assert in those accessors that the value is either undefined or
a string?
https://codereview.chromium.org/48923002/diff/70001/src/objects.h
File src/objects.h (right):
https://codereview.chromium.org/48923002/diff/70001/src/objects.h#newcode363
src/objects.h:363: \
stray edit?
https://codereview.chromium.org/48923002/
--
--
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/groups/opt_out.