Remove the partially completed code for remote IsolateMirrors and

replace it with the beginnings of a local (same isolate) IsolateMirror
implementation.

Removed old mirror tests and added two new mirror tests.

Even though mirrors.cc is part of the vm, I chose to implement most of
it using the dart embedding interface instead of our internal
interfaces because the embedding interface was more convenient.
mirrors.cc is basically all new in this CL -- don't pay any attention
to diffs for that file.

Added dart embedding functions required for the functionality in this
CL: Dart_DebugName, Dart_GetNativeInstanceFieldCount,
Dart_RootLibrary, Dart_RegisteredLibraryUrls, and Dart_LibraryName.

Extended or modified some existing dart api functions, primarily to
make them propagate error handles properly.

Added tests for new dart embedding api functionality.

Added the ability to determine if a port is local to the current isolate.

Extended NotImplementedException to accept an optional string
argument.  I wanted to give more descriptive error messages.
Review URL: https://chromiumcodereview.appspot.com//10416050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8117 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
turnidge@google.com
2012-05-30 17:07:19 +00:00
parent d0686c5a52
commit ec36e02c28
23 changed files with 877 additions and 276 deletions
+19
View File
@@ -51,6 +51,9 @@ class DynamicAssertionHelper {
template<typename E, typename A>
void IsSubstring(const E& needle, const A& haystack);
template<typename E, typename A>
void IsNotSubstring(const E& needle, const A& haystack);
template<typename E, typename A>
void LessThan(const E& left, const A& right);
@@ -157,6 +160,19 @@ void DynamicAssertionHelper::IsSubstring(const E& needle, const A& haystack) {
}
template<typename E, typename A>
void DynamicAssertionHelper::IsNotSubstring(const E& needle,
const A& haystack) {
std::stringstream ess, ass;
ess << needle;
ass << haystack;
std::string es = ess.str(), as = ass.str();
if (as.find(es) == std::string::npos) return;
Fail("expected <\"%s\"> to not be a substring of <\"%s\">",
es.c_str(), as.c_str());
}
template<typename E, typename A>
void DynamicAssertionHelper::LessThan(const E& left, const A& right) {
if (left < right) return;
@@ -276,6 +292,9 @@ void DynamicAssertionHelper::NotNull(const T p) {
#define EXPECT_SUBSTRING(needle, haystack) \
dart::Expect(__FILE__, __LINE__).IsSubstring((needle), (haystack))
#define EXPECT_NOTSUBSTRING(needle, haystack) \
dart::Expect(__FILE__, __LINE__).IsNotSubstring((needle), (haystack))
#define EXPECT_LT(left, right) \
dart::Expect(__FILE__, __LINE__).LessThan((left), (right))