Bug 15194 - Invalid return statement in two layout tests
Summary: Invalid return statement in two layout tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-12 14:59 PDT by John Seif
Modified: 2007-09-12 23:00 PDT (History)
0 users

See Also:


Attachments
Reduced test case of invalid return statement (124 bytes, text/html)
2007-09-12 15:01 PDT, John Seif
no flags Details
Take out the invalid return statements. (2.38 KB, patch)
2007-09-12 15:02 PDT, John Seif
darin: review-
Details | Formatted Diff | Diff
Patch with ChangeLog (2.88 KB, patch)
2007-09-12 15:33 PDT, John Seif
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Seif 2007-09-12 14:59:46 PDT
I've been trying out some of the plugin layout tests, and have noticed that these two have invalid js:

plugins\mouse-events.html
plugins\open-and-close-window-with-plugin.html

The problem is that there's a return statement that's not in a function.  Only KJS seems to handle this fine, Firefox/IE choke.  I'll attach a reduced test case.  ECMA-262, section 12.9, page 67 states that an EMCAScript program is considered syntactically incorrect if it contains a return statement that is not within the body of a function.
Comment 1 John Seif 2007-09-12 15:01:01 PDT
Created attachment 16269 [details]
Reduced test case of invalid return statement

This prints FAIL in Firefox/IE, but PASS in Safari.
Comment 2 John Seif 2007-09-12 15:02:40 PDT
Created attachment 16270 [details]
Take out the invalid return statements.
Comment 3 Darin Adler 2007-09-12 15:07:58 PDT
Comment on attachment 16270 [details]
Take out the invalid return statements.

The flag to set to ask for review is "?", not "+". A "+" is set by a reviewer.

This patch looks great. Just needs a change log.
Comment 4 John Seif 2007-09-12 15:33:30 PDT
Created attachment 16271 [details]
Patch with ChangeLog
Comment 5 John Seif 2007-09-12 15:34:29 PDT
ah, thanks, I missed that part.  Added another patch with the change log.
Comment 6 Darin Adler 2007-09-12 15:52:27 PDT
Comment on attachment 16271 [details]
Patch with ChangeLog

Looks good, r=me.
Comment 7 Mark Rowe (bdash) 2007-09-12 16:19:15 PDT
Can we get a bug filed about accepting "return" outside of functions?
Comment 8 David Kilzer (:ddkilzer) 2007-09-12 22:43:32 PDT
(In reply to comment #7)
> Can we get a bug filed about accepting "return" outside of functions?

Bug 15200.

Comment 9 David Kilzer (:ddkilzer) 2007-09-12 23:00:56 PDT
Committed revision 25531.