Files
sdk/tests/language/import/internal_library_test.dart
T
Robert Nystrom d35702e83a Migrate language_2/import to NNBD.
Change-Id: I95d0545c17bd0755424c50f3c5c5f8b89b8c01de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148944
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-26 18:26:00 +00:00

34 lines
1.1 KiB
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test that a private library cannot be accessed from outside the platform.
library internal_library_test;
import 'dart:core'; // This loads 'dart:_foreign_helper' and 'patch:core'.
import 'dart:_foreign_helper';
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.IMPORT_INTERNAL_LIBRARY
// [cfe] Can't access platform private library.
// ^
// [cfe] Not found: 'dart:_foreign_helper'
part 'dart:_foreign_helper';
// ^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.PART_OF_NON_PART
// [cfe] Can't access platform private library.
// ^
// [cfe] Can't use 'org-dartlang-untranslatable-uri:dart%3A_foreign_helper' as a part, because it has no 'part of' declaration.
// ^
// [cfe] Not found: 'dart:_foreign_helper'
void main() {
JS('int', '0');
//^
// [cfe] Method not found: 'JS'.
JS('int', '0');
//^
// [cfe] Method not found: 'JS'.
}