Files
sdk/tests/language/string_no_operator_test.dart
T
Asger Feldthaus 0220393797 dart2js cps: Bugfix in operator specialization.
Binary operators were always replaced with string concatenation if both
operands were strings.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1210403008.
2015-07-06 11:15:02 +02:00

27 lines
757 B
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.
import 'package:expect/expect.dart';
main() {
var x = "x";
var y = "y";
Expect.throws(() => x < y);
Expect.throws(() => x <= y);
Expect.throws(() => x > y);
Expect.throws(() => x >= y);
Expect.throws(() => x - y);
Expect.throws(() => x * y);
Expect.throws(() => x / y);
Expect.throws(() => x ~/ y);
Expect.throws(() => x % y);
Expect.throws(() => x >> y);
Expect.throws(() => x << y);
Expect.throws(() => x & y);
Expect.throws(() => x | y);
Expect.throws(() => x ^ y);
Expect.throws(() => -x);
Expect.throws(() => ~x);
}