Reviewers: Sven Panne,
Message:
svenpanne, ptal
Description:
Refactor script compilation / running & use of helper funcs in test-api.cc.
The tests were using different kind of constructs for achieving the same
thing. This makes refactoring the compilation API more difficult than it
should
be.
cctest.h already contained helpers for compiling and running scripts, but
they
were not used consistently.
For example, all these were used for running scripts:
v8::Script::Compile(v8_str("foo"))->Run();
v8::Script::Compile(v8::String::NewFromUtf8(isolate, "foo))->Run();
CompileRun(v8_str("foo"));
CompileRun(v8::String::NewFromUtf8(some_way_to_get_isolate(), "foo"));
v8::Local<v8::Script> script = any_of_the_above; script->Run();
Most of the tests just want to run a script (which is in const char*) and
don't
care about how the v8::String is constructed or passed to the compilerAPI.
Using
the helpers makes the test more readable and reduces boilerplate code which
is
unrelated to what the test is testing.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/190503002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+264, -262 lines):
M test/cctest/cctest.h
M test/cctest/test-api.cc
--
--
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.