Files
sdk/pkg/dev_compiler/test/codegen/cascade.dart
T
Vijay Menon 5c1c9c2381 Add LICENSE and corresponding headers
Fix expectations where line number has changed.

R=dgrove@google.com

Review URL: https://chromereviews.googleplex.com/158257013
2015-02-24 15:02:26 -08:00

71 lines
1.1 KiB
Dart

// Copyright (c) 2015, 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.
class A {
var x;
}
void test_closure_with_mutate() {
var a = new A();
a.x = () {
print("hi");
a = null;
};
a
..x()
..x();
print(a);
}
void test_closure_without_mutate() {
var a = new A();
a.x = () {
print(a);
};
a
..x()
..x();
print(a);
}
void test_mutate_inside_cascade() {
var a;
a = new A()
..x = (a = null)
..x = (a = null);
print(a);
}
void test_mutate_outside_cascade() {
var a, b;
a = new A()
..x = (b = null)
..x = (b = null);
a = null;
print(a);
}
void test_VariableDeclaration_single() {
var a = []
..length = 2
..add(42);
print(a);
}
void test_VariableDeclaration_last() {
var a = 42,
b = []
..length = 2
..add(a);
print(b);
}
void test_VariableDeclaration_first() {
var a = []
..length = 2
..add(3),
b = 2;
print(a);
}