matches method Null safety

bool matches(
  1. StackFrame stackFrame
)

Tests whether the StackFrame matches the information in this PartialStackFrame.

Implementation

bool matches(StackFrame stackFrame) {
  final String stackFramePackage = '${stackFrame.packageScheme}:${stackFrame.package}/${stackFrame.packagePath}';
  // Ideally this wouldn't be necessary.
  // TODO(dnfield): https://github.com/dart-lang/sdk/issues/40117
  if (kIsWeb) {
    return package.allMatches(stackFramePackage).isNotEmpty
        && stackFrame.method == (method.startsWith('_') ? '[$method]' : method);
  }
  return package.allMatches(stackFramePackage).isNotEmpty
      && stackFrame.method == method
      && stackFrame.className == className;
}