File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 11library angular.core.facade.lang;
22
3- export 'dart:core' show Type;
3+ export 'dart:core' show Type, RegExp;
4+ import 'dart:math' as math;
5+
6+ class Math {
7+ static final _random = new math.Random ();
8+ static int floor (num n) => n.floor ();
9+ static double random () => _random.nextDouble ();
10+ }
411
512class FIELD {
613 final String definition;
@@ -58,3 +65,21 @@ class NumberWrapper {
5865 }
5966}
6067
68+ class RegExpWrapper {
69+ static RegExp create (regExpStr) {
70+ return new RegExp (regExpStr);
71+ }
72+ static matcher (regExp, input) {
73+ return regExp.allMatches (input).iterator;
74+ }
75+ }
76+
77+ class RegExpMatcherWrapper {
78+ static next (matcher) {
79+ if (matcher.moveNext ()) {
80+ return matcher.current;
81+ }
82+ return null ;
83+ }
84+ }
85+
Original file line number Diff line number Diff line change 11export var Type = Function ;
2+ export var Math = window . Math ;
23
34export class FIELD {
45 constructor ( definition ) {
@@ -107,3 +108,24 @@ export function int() {};
107108int . assert = function ( value ) {
108109 return value == null || typeof value == 'number' && value === Math . floor ( value ) ;
109110}
111+
112+ export var RegExp = window . RegExp ;
113+
114+ export class RegExpWrapper {
115+ static create ( regExpStr ) :RegExp {
116+ return new RegExp ( regExpStr , 'g' ) ;
117+ }
118+ static matcher ( regExp , input ) {
119+ return {
120+ re : regExp ,
121+ input : input
122+ } ;
123+ }
124+ }
125+
126+ export class RegExpMatcherWrapper {
127+ static next ( matcher ) {
128+ return matcher . re . exec ( matcher . input ) ;
129+ }
130+ }
131+
You can’t perform that action at this time.
0 commit comments