File tree 7 files changed +28
-0
lines changed
7 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ export namespace CommonNames {
210
210
export const I31ref = "I31ref" ;
211
211
export const Dataref = "Dataref" ;
212
212
export const String = "String" ;
213
+ export const RegExp = "RegExp" ;
213
214
export const Object = "Object" ;
214
215
export const Array = "Array" ;
215
216
export const StaticArray = "StaticArray" ;
Original file line number Diff line number Diff line change @@ -634,6 +634,14 @@ export class Program extends DiagnosticEmitter {
634
634
}
635
635
private _stringInstance : Class | null = null ;
636
636
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
+
637
645
/** Gets the standard `Object` instance. */
638
646
get objectInstance ( ) : Class {
639
647
var cached = this . _objectInstance ;
Original file line number Diff line number Diff line change @@ -2231,6 +2231,9 @@ export class Resolver extends DiagnosticEmitter {
2231
2231
case LiteralKind . TEMPLATE : {
2232
2232
return this . program . stringInstance ;
2233
2233
}
2234
+ case LiteralKind . REGEXP : {
2235
+ return this . program . regexpInstance ;
2236
+ }
2234
2237
case LiteralKind . ARRAY : {
2235
2238
let classReference = ctxType . getClass ( ) ;
2236
2239
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