| OLD | NEW |
| 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 var dart_sdk = dart_library.import('dart_sdk'); | 6 var dart_sdk = dart_library.import('dart_sdk'); |
| 7 var core = dart_sdk.core; | 7 var core = dart_sdk.core; |
| 8 var collection = dart_sdk.collection; | 8 var collection = dart_sdk.collection; |
| 9 var dart = dart_sdk.dart; | 9 var dart = dart_sdk.dart; |
| 10 var dartx = dart.dartx; | 10 var dartx = dart.dartx; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 assert.throws(() => dart.dcall(i_i2i, 0, 1)); | 525 assert.throws(() => dart.dcall(i_i2i, 0, 1)); |
| 526 assert.throws(() => dart.dcall(i_i2i, "hello", "world")); | 526 assert.throws(() => dart.dcall(i_i2i, "hello", "world")); |
| 527 assert.equal(dart.dcall(i_i2i, 0), 0); | 527 assert.equal(dart.dcall(i_i2i, 0), 0); |
| 528 assert.throws(() => dart.dcall(i_i2i, 0, 1, 2)); | 528 assert.throws(() => dart.dcall(i_i2i, 0, 1, 2)); |
| 529 assert.equal(dart.dcall(i_i2i, 0, {extra: 3}), 0); | 529 assert.equal(dart.dcall(i_i2i, 0, {extra: 3}), 0); |
| 530 }); | 530 }); |
| 531 | 531 |
| 532 test('dsend', () => { | 532 test('dsend', () => { |
| 533 class Tester extends core.Object { | 533 class Tester extends core.Object { |
| 534 Tester() { | 534 new() { |
| 535 this.f = dart.fn(x => x, core.int, [core.int]); | 535 this.f = dart.fn(x => x, core.int, [core.int]); |
| 536 this.me = this; | 536 this.me = this; |
| 537 } | 537 } |
| 538 m(x, y) {return x;} | 538 m(x, y) {return x;} |
| 539 call(x) {return x;} | 539 call(x) {return x;} |
| 540 static s(x, y) { return x;} | 540 static s(x, y) { return x;} |
| 541 } | 541 } |
| 542 dart.setSignature(Tester, { | 542 dart.setSignature(Tester, { |
| 543 methods: () => ({ | 543 methods: () => ({ |
| 544 m: [core.int, [core.int, core.int]], | 544 m: [core.int, [core.int, core.int]], |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 | 1157 |
| 1158 suite('primitives', function() { | 1158 suite('primitives', function() { |
| 1159 'use strict'; | 1159 'use strict'; |
| 1160 | 1160 |
| 1161 test('fixed length list', () => { | 1161 test('fixed length list', () => { |
| 1162 let list = new core.List(10); | 1162 let list = new core.List(10); |
| 1163 list[0] = 42; | 1163 list[0] = 42; |
| 1164 assert.throws(() => list.add(42)); | 1164 assert.throws(() => list.add(42)); |
| 1165 }); | 1165 }); |
| 1166 }); | 1166 }); |
| OLD | NEW |