File tree Expand file tree Collapse file tree 7 files changed +28
-0
lines changed Expand file tree Collapse file tree 7 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ export namespace CommonNames {
210210 export const I31ref = "I31ref" ;
211211 export const Dataref = "Dataref" ;
212212 export const String = "String" ;
213+ export const RegExp = "RegExp" ;
213214 export const Object = "Object" ;
214215 export const Array = "Array" ;
215216 export const StaticArray = "StaticArray" ;
Original file line number Diff line number Diff line change @@ -634,6 +634,14 @@ export class Program extends DiagnosticEmitter {
634634 }
635635 private _stringInstance : Class | null = null ;
636636
637+ /** Gets the standard `RegExp` instance. */
638+ get regexpInstance ( ) : Class {
639+ var cached = this . _regexpInstance ;
640+ if ( ! cached ) this . _regexpInstance = cached = this . requireClass ( CommonNames . RegExp ) ;
641+ return cached ;
642+ }
643+ private _regexpInstance : Class | null = null ;
644+
637645 /** Gets the standard `Object` instance. */
638646 get objectInstance ( ) : Class {
639647 var cached = this . _objectInstance ;
Original file line number Diff line number Diff line change @@ -2231,6 +2231,9 @@ export class Resolver extends DiagnosticEmitter {
22312231 case LiteralKind . TEMPLATE : {
22322232 return this . program . stringInstance ;
22332233 }
2234+ case LiteralKind . REGEXP : {
2235+ return this . program . regexpInstance ;
2236+ }
22342237 case LiteralKind . ARRAY : {
22352238 let classReference = ctxType . getClass ( ) ;
22362239 if ( classReference && classReference . prototype == this . program . arrayPrototype ) {
Original file line number Diff line number Diff line change 1+ {
2+ "asc_flags" : [
3+ ],
4+ "stderr" : [
5+ " TS2329: Index signature is missing in type '~lib/regexp/RegExp'"
6+ ]
7+ }
Original file line number Diff line number Diff line change 1+ / / [ 0 ] ;
Original file line number Diff line number Diff line change 1+ {
2+ "asc_flags" : [
3+ ],
4+ "stderr" : [
5+ " AS100: Not implemented: Regular expressions"
6+ ]
7+ }
Original file line number Diff line number Diff line change 1+ typeof / / ;
You can’t perform that action at this time.
0 commit comments