Closed Bug 476088 Opened 14 years ago Closed 11 years ago

trap() changes TypeError message

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Assigned: h4writer)

Details

(Keywords: testcase)

Attachments

(1 file)

js> f = function() { var x; x.y; }
function () {
    var x;
    x.y;
}

js> dis(f);
flags: LAMBDA INTERPRETED
main:
00000:  getlocal 0
00003:  pop
00004:  getlocalprop 0 "y"
00009:  pop
00010:  stop

Source notes:
  0:     0 [   0] decl     offset 0

js> f();
typein:1: TypeError: x is undefined
js> trap(f, 0, "");
js> f();
typein:1: TypeError: x.y is undefined
Using latest mozilla-inbound I get the following when executing the testcase:

js> f = function() { var x; x.y; }
(function () {var x;x.y;})
js> dis(f);
flags: LAMBDA NULL_CLOSURE
loc     op
-----   --
main:
00000:  getlocal 0
00003:  pop
00004:  getlocal 0
00007:  getprop "y"
00010:  pop
00011:  stop

Source notes:
 ofs  line    pc  delta desc     args
---- ---- ----- ------ -------- ------
  0:    1     0 [   0] decl     offset 0
  2:    1     7 [   7] pcbase   offset 3

js> f();
typein:1: TypeError: x is undefined
js> trap(f, 0, "");
js> f();
typein:1: TypeError: x is undefined
js> 

Could not find the original bug report fixing this bug,
so I mark it as WORKSFORME.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Flags: in-testsuite?
Attached patch Add testcaseSplinter Review
@Ryan: I suppose that flag means you want a testcase? I added a patch containing the testcase. I hope it is in the right place with the right parameters (debug needed!)? I added you as reviewer. Feel free to point it to somebody else, but it's only a testcase ...
Assignee: general → hv1989
Status: RESOLVED → REOPENED
Attachment #577606 - Flags: review?(ryanvm)
Resolution: WORKSFORME → ---
Comment on attachment 577606 [details] [diff] [review]
Add testcase

In general, it's always good to add tests for bugs that go away whether FIXED or WORKSFORME. I'm not the right reviewer for it though. Sending over to Jesse. I can push it to try later, though.
Attachment #577606 - Flags: review?(ryanvm) → review?(jruderman)
Attachment #577606 - Flags: review?(jruderman) → review+
Thanks for converting the test, Hannes :)
https://hg.mozilla.org/integration/mozilla-inbound/rev/c7d671e9cf58

For future reference, it would be awesome to have a checkin comment and User/From line in the patch!
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → WORKSFORME
Flags: in-testsuite? → in-testsuite+
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.