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

Side by Side Diff: test/browser/runtime_tests.js

Issue 1135543003: Fixes #178 (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Reformat Created 5 years, 7 months 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 | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/constructors.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 var assert = chai.assert; 5 var assert = chai.assert;
6 6
7 suite('generic', () => { 7 suite('generic', () => {
8 "use strict"; 8 "use strict";
9 9
10 let generic = dart.generic; 10 let generic = dart.generic;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 assert.strictEqual(Object.keys(t1).length, 0); 65 assert.strictEqual(Object.keys(t1).length, 0);
66 assert.strictEqual(Object.keys(t2).length, 0); 66 assert.strictEqual(Object.keys(t2).length, 0);
67 }); 67 });
68 68
69 test('type constructor is reflectable', () => { 69 test('type constructor is reflectable', () => {
70 let SomeType = generic(function(x, y) { return Object.create(null); }); 70 let SomeType = generic(function(x, y) { return Object.create(null); });
71 let someValue = SomeType('hi', 123); 71 let someValue = SomeType('hi', 123);
72 assert.equal(someValue[dart.originalDeclaration], SomeType); 72 assert.equal(someValue[dart.originalDeclaration], SomeType);
73 assert.deepEqual(someValue[dart.typeArguments], ['hi', 123]); 73 assert.deepEqual(someValue[dart.typeArguments], ['hi', 123]);
74 }); 74 });
75
76 test('proper type constructor is called', () => {
77 // This tests https://github.com/dart-lang/dev_compiler/issues/178
78 let l = dart.setType([1, 2, 3], core.List$(core.int));
79 let s = l[core.$join]();
80 assert.equal(s, '123');
81 });
75 }); 82 });
76 83
77 84
78 suite('instanceOf', () => { 85 suite('instanceOf', () => {
79 "use strict"; 86 "use strict";
80 87
81 let expect = assert.equal; 88 let expect = assert.equal;
82 let isGroundType = dart.isGroundType; 89 let isGroundType = dart.isGroundType;
83 let generic = dart.generic; 90 let generic = dart.generic;
84 let intIsNonNullable = false; 91 let intIsNonNullable = false;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 401
395 suite('primitives', function() { 402 suite('primitives', function() {
396 'use strict'; 403 'use strict';
397 404
398 test('fixed length list', () => { 405 test('fixed length list', () => {
399 let list = new core.List(10); 406 let list = new core.List(10);
400 list[0] = 42; 407 list[0] = 42;
401 assert.throws(() => list.add(42)); 408 assert.throws(() => list.add(42));
402 }); 409 });
403 }); 410 });
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698