PropertyDescriptor::initialize can throw a SyntaxError instead of a TypeError

RESOLVED FIXED in mozilla1.9.3a5

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: jorendorff, Assigned: Waldo)

Tracking

Other Branch
mozilla1.9.3a5
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
js> Object.defineProperty({}, "p", {get: 23})
typein:1: SyntaxError: invalid getter usage

The error message itself should probably say "invalid getter" at worst. Of course in Ponyland it would say something like,

  The property descriptor is invalid. The "get" field must be either
  a function or undefined, not 23.

Ponyland is so nice.
(Assignee)

Updated

9 years ago
Summary: PropertySpec::initialize can throw a SyntaxError → PropertyDescriptor::initialize can throw a SyntaxError instead of a TypeError
(Assignee)

Comment 1

9 years ago
Created attachment 436798 [details] [diff] [review]
Patch and tests

I'd really thought I was doing this error-type checking already, but I guess not.
Attachment #436798 - Flags: review?(jorendorff)
(Reporter)

Updated

9 years ago
Attachment #436798 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 2

9 years ago
http://hg.mozilla.org/tracemonkey/rev/988aee821e1c
Status: NEW → ASSIGNED
Whiteboard: fixed-in-tracemonkey
Target Milestone: --- → mozilla1.9.3a5

Comment 3

9 years ago
http://hg.mozilla.org/mozilla-central/rev/988aee821e1c
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.