Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: tests/language/mixin_proto_test.dart

Issue 2550903002: Fix csp mode on platforms that don't support __proto__. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Tests that a program in csp mode doesn't access the prototype chain
6 // on platforms that don't support direct access to __proto__.
7 // This test is most useful with --csp and on a platform that doesn't support
8 // __proto__ access (such as Rhino).
9 // See http://dartbug.com/27290 .
10
11 import 'package:expect/expect.dart';
12
13 class A {
14 var x;
15 foo() => 44;
16 bar() => 22;
17 }
18
19 class B {
20 var y;
21 foo() => 42;
22 }
23
24 class C extends A with B {
25 var z;
26 bar() => 499;
27 }
28
29 main() {
30 var all = [new A(), new B(), new C()];
sra1 2017/02/23 23:43:39 Always use a 'confuse' function to obfuscate. It w
floitsch 2017/02/24 12:35:29 https://codereview.chromium.org/2712603006/
31 Expect.equals(44, all[0].foo());
32 Expect.equals(22, all[0].bar());
33 Expect.equals(42, all[1].foo());
34 Expect.equals(42, all[2].foo());
35 Expect.equals(499, all[2].bar());
36 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698