Move MessageLocations constructor out of header

This is a bit unfortunate, but otherwise we would have to include
objects.h before message.h, since for the initialization of a Handle<T>,
the compiler checks that Object* can be assigned to T*. So it would
need to know about the inheritance for initializing Handle<Script> and
Handle<JSFunction>.

R=mstarzinger@chromium.org, titzer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1872373002

Cr-Commit-Position: refs/heads/master@{#35626}
This commit is contained in:
clemensh 2016-04-19 08:13:08 -07:00 committed by Commit bot
parent 1705b7de4f
commit e2ec04d2ab
2 changed files with 13 additions and 6 deletions

View File

@ -12,6 +12,16 @@
namespace v8 {
namespace internal {
MessageLocation::MessageLocation(Handle<Script> script, int start_pos,
int end_pos)
: script_(script), start_pos_(start_pos), end_pos_(end_pos) {}
MessageLocation::MessageLocation(Handle<Script> script, int start_pos,
int end_pos, Handle<JSFunction> function)
: script_(script),
start_pos_(start_pos),
end_pos_(end_pos),
function_(function) {}
MessageLocation::MessageLocation() : start_pos_(-1), end_pos_(-1) {}
// If no message listeners have been registered this one is called
// by default.

View File

@ -24,13 +24,10 @@ class SourceInfo;
class MessageLocation {
public:
MessageLocation(Handle<Script> script, int start_pos, int end_pos);
MessageLocation(Handle<Script> script, int start_pos, int end_pos,
Handle<JSFunction> function = Handle<JSFunction>())
: script_(script),
start_pos_(start_pos),
end_pos_(end_pos),
function_(function) {}
MessageLocation() : start_pos_(-1), end_pos_(-1) { }
Handle<JSFunction> function);
MessageLocation();
Handle<Script> script() const { return script_; }
int start_pos() const { return start_pos_; }