OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/static_inline_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__static_inline_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const expect$ = expect.expect; |
| 10 const static_inline_test = Object.create(null); |
| 11 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 12 static_inline_test.StringScanner = class StringScanner extends core.Object { |
| 13 new() { |
| 14 this.byteOffset = -1; |
| 15 } |
| 16 nextByte(foo) { |
| 17 if (dart.test(foo)) return -2; |
| 18 return static_inline_test.StringScanner.charAt((this.byteOffset = dart.not
Null(this.byteOffset) + 1)); |
| 19 } |
| 20 static charAt(index) { |
| 21 return dart.notNull(static_inline_test.StringScanner.string[dartx.length])
> dart.notNull(core.num._check(index)) ? static_inline_test.StringScanner.strin
g[dartx.codeUnitAt](core.int._check(index)) : -1; |
| 22 } |
| 23 }; |
| 24 dart.setSignature(static_inline_test.StringScanner, { |
| 25 methods: () => ({nextByte: dart.definiteFunctionType(core.int, [dart.dynamic
])}), |
| 26 statics: () => ({charAt: dart.definiteFunctionType(core.int, [dart.dynamic])
}), |
| 27 names: ['charAt'] |
| 28 }); |
| 29 static_inline_test.StringScanner.string = null; |
| 30 static_inline_test.main = function() { |
| 31 let scanner = new static_inline_test.StringScanner(); |
| 32 static_inline_test.StringScanner.string = 'az9'; |
| 33 expect$.Expect.equals(97, scanner.nextByte(false)); |
| 34 expect$.Expect.equals(122, scanner.nextByte(false)); |
| 35 expect$.Expect.equals(57, scanner.nextByte(false)); |
| 36 expect$.Expect.equals(-1, scanner.nextByte(false)); |
| 37 }; |
| 38 dart.fn(static_inline_test.main, VoidTovoid()); |
| 39 // Exports: |
| 40 exports.static_inline_test = static_inline_test; |
| 41 }); |
OLD | NEW |