Skip to content

RegExp Symbol methods should accept protocol objects, not just RegExp instances #616

@frostney

Description

@frostney

Summary

RegExp.prototype Symbol methods should accept any object with the corresponding Symbol method, not just RegExp instances.

Why

23 test262 tests fail with "called on non-RegExp object" when passing protocol objects.

Current behavior

RegExp.prototype[Symbol.split].call(protocolObj, str) throws TypeError.

Expected behavior

The method dispatches through the protocol object's Symbol method.

Scope notes

  • Relax IsRegExpValue check in Symbol methods while keeping it strict for exec/test
  • Goccia.Builtins.GlobalRegExp.pas

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMspec complianceMismatch against official JavaScript/TypeScript specification

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions