[test,ddc] Update library test to use static method

The test was relying on the runtime type representation to verify
that the library object returned from `getLibrary` was correct. Now
it uses the static `print()` method instead to avoid issues in the new
type system.

Change-Id: Iaa26427e46afd0e7f4ae0a84cb4c123755484647
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335023
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Nicholas Shahan 2023-11-10 20:39:00 +00:00 committed by Commit Queue
parent b9e25afcb4
commit b82465111c
2 changed files with 10 additions and 4 deletions

View file

@ -27,6 +27,9 @@ void main() {
// Test getLibrary(...) // Test getLibrary(...)
var core = dart.getLibrary('dart:core'); var core = dart.getLibrary('dart:core');
var stackTraceType = dart.wrapType(JS('', '#.StackTrace', core)); // Using the print method to verify we get the same library object.
Expect.equals(StackTrace, stackTraceType); // The print method is only used here because we know it is a member of the
// dart:core library.
var printMethod = JS('', '#.print', core);
Expect.equals(print, printMethod);
} }

View file

@ -29,6 +29,9 @@ void main() {
// Test getLibrary(...) // Test getLibrary(...)
var core = dart.getLibrary('dart:core'); var core = dart.getLibrary('dart:core');
var stackTraceType = dart.wrapType(JS('', '#.StackTrace', core)); // Using the print method to verify we get the same library object.
Expect.equals(StackTrace, stackTraceType); // The print method is only used here because we know it is a member of the
// dart:core library.
var printMethod = JS('', '#.print', core);
Expect.equals(print, printMethod);
} }