mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:47:03 +00:00
9e10ef4458
Fixes VM, DDC and Dart2js. BUG= http://dartbug.com/39406 Change-Id: If181eaf50905c571614b656a232564e394e1b35d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136635 Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Teagan Strickland <sstrickl@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
18 lines
592 B
Dart
18 lines
592 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
// See http://dartbug.com/39406
|
|
//
|
|
// The following code must not throw.
|
|
|
|
void main() {
|
|
var regExp = RegExp(r'\w+');
|
|
var message = 'Hello world!';
|
|
var match = regExp.firstMatch(message);
|
|
var groupNames = match!.groupNames.toList();
|
|
Expect.listEquals([], groupNames);
|
|
Expect.throwsArgumentError(() => match.namedGroup("x"));
|
|
} |