dart-sdk/tests/language_2/js_properties_test.dart
Jakob Roland Andersen eaafacb59d Revert "Revert "Reland "Migrated test batch 123 to Dart 2.0."""
This reverts commit 85e8613e66.

Reason for revert: Giving this one last try.

Wasn't able to reproduce the buildbot's failure on macOS or Windows, so
marking the entire test as RuntimeError, instead of just part of it.

GitHub issue: https://github.com/dart-lang/sdk/issues/30675

Original change's description:
> > This is a reland of 594e6cf010
> > Original change's description:
> > > Migrated test batch 123 to Dart 2.0.
> > > 
> > > Bug:
> > > Change-Id: I780329831dc189add7b192faf85161659a4a8b53
> > > Reviewed-on: https://dart-review.googlesource.com/4800
> > > Reviewed-by: Florian Loitsch <floitsch@google.com>
TBR=jakobr@google.com,floitsch@google.com

Change-Id: I0508cf605c40125132a807a019b5cf412a393ac9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/5680
Commit-Queue: Jakob Roland Andersen <jakobr@google.com>
Reviewed-by: Jakob Roland Andersen <jakobr@google.com>
2017-09-14 08:29:07 +00:00

47 lines
1.3 KiB
Dart

// Copyright (c) 2012, 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 JavaScript properties on Object can still be classes in
// Dart.
import "package:expect/expect.dart";
void main() {
Expect.equals(42, new __defineGetter__().hello());
Expect.equals(42, new __defineSetter__().hello());
Expect.equals(42, new __lookupGetter__().hello());
Expect.equals(42, new __lookupSetter__().hello());
Expect.equals(42, new constructor().hello());
Expect.equals(42, new hasOwnProperty().hello());
Expect.equals(42, new isPrototypeOf().hello());
Expect.equals(42, new propertyIsEnumerable().hello());
Expect.equals(42, new toLocaleString().hello());
Expect.equals(42, new toString().hello());
Expect.equals(42, new valueOf().hello());
}
class Hello {
int hello() => 42;
}
class __defineGetter__ extends Hello {}
class __defineSetter__ extends Hello {}
class __lookupGetter__ extends Hello {}
class __lookupSetter__ extends Hello {}
class constructor extends Hello {}
class hasOwnProperty extends Hello {}
class isPrototypeOf extends Hello {}
class propertyIsEnumerable extends Hello {}
class toLocaleString extends Hello {}
class toString extends Hello {}
class valueOf extends Hello {}