Closed Bug 1868429 Opened 2 years ago Closed 2 years ago

WebIDL Tokenizer should use self._filename for error handling

Categories

(Core :: DOM: Bindings (WebIDL), enhancement)

enhancement

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 external files)

Parser sets self._filename and Tokenizer uses it in error handling.

https://searchfox.org/mozilla-central/rev/413b88689f3ca2a30b3c49465730c0e7d40f9188/dom/bindings/parser/WebIDL.py#8910,8934,8958,8964

class Parser(Tokenizer):
...
  def __init__(self, outputdir="", lexer=None):
...
      self._filename = "<builtin>"
...
  def parse(self, t, filename=None):
...
      self._filename = filename

https://searchfox.org/mozilla-central/rev/413b88689f3ca2a30b3c49465730c0e7d40f9188/dom/bindings/parser/WebIDL.py#6933,6941,6954

class Tokenizer(object):
...
    def t_INTEGER(self, t):
...
                        filename=self._filename,

but the following case uses self.filename, and it hits error when there's any error in input.

https://searchfox.org/mozilla-central/rev/413b88689f3ca2a30b3c49465730c0e7d40f9188/dom/bindings/parser/WebIDL.py#7060,7068

def t_error(self, t):
...
                filename=self.filename,
Attachment #9367114 - Attachment description: Bug 1868429 - Fix WebIDL Tokenizer to use correct member. r?smaug! → Bug 1868429 - Part 1: Fix WebIDL Tokenizer to use correct member. r?peterv!
See Also: → 1868570
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/6b92d101e60f Part 1: Fix WebIDL Tokenizer to use correct member. r=peterv https://hg.mozilla.org/integration/autoland/rev/d7e3a3f57d5e Part 2: Perform stricter exception checking in WebIDL parser tests. r=peterv
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: