Closed Bug 127990 Opened 23 years ago Closed 20 years ago

aircanada.ca - void function f() { } doesn't define function f

Categories

(Tech Evangelism Graveyard :: English Other, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: shaver, Unassigned)

References

()

Details

(Whiteboard: [syntax-js])

This site has some bonus whitespace in the name attribute, at

 <form method="post" name =" displayValues"
action="https://w4.aircanada.ca/servlet/CTO5SearchServlet/selectpromotional"
onSubmit="parseRequest()">

It then tries to access that form via document.forms["displayValues"].  That
doesn't work.

IE handles this fine, as does 4.x.  Can we -- at least in quirks mode -- strip
(leading-only?) whitespace from name?

If you say yes, I might even be convinced to whip up a quick patch for it myself.
Should be quirks mode only, name is CDATA and spaces are significant.
Keywords: compat
Parser does not process attributes it only consumes them, i.e., the parser would
preserve everything within quotes. It's layout that should be ignoring unwanted
whitespaces etc. I'm pretty sure there is another open bug on this issue.

--> Layout
Assignee: harishd → attinasi
Component: Parser → Layout
QA Contact: moied → petersen
So, 4.x and IE really do the same thing here.  The whitespace was a red herring.
 We have a JS engine glitch, it looks like.

The web test URL is http://www.aircanada.ca/websaver/YULe.html, the one in the
URL field above is for easy testing.

Dammit.
Component: Layout → JavaScript Engine
Keywords: 4xp
QA Contact: petersen → pschwartau
Summary: <form name=" foo"> doesn't work as document.forms.foo → void function f() { } doesn't define function f
Taking the bug (which brendan now tells me is an ECMA-compliance issue).  Bah.
Assignee: attinasi → shaver
Bah to whom?  ECMA-262 Edition 3 11.2.5, 11.4.2 and 13 (see especially the NOTE
under Semantics for evaluating the FunctionExpression production) say that we're
right, for a change.  Rejoice, evangelize.

/be
Here are those ECMA sections:

11.4.2 The void Operator
The production UnaryExpression : void UnaryExpression is evaluated as follows:
1. Evaluate UnaryExpression.
2. Call GetValue(Result(1)).
3. Return undefined.

11.2.5 Function Expressions
The production MemberExpression : FunctionExpression is evaluated as follows:
1. Evaluate FunctionExpression.
2. Return Result(1).


Chapter 13 Function Definition

The production
FunctionExpression : function Identifier ( FormalParameterListopt ) { 
FunctionBody } is evaluated as follows:

1. Create a new object as if by the expression new Object().
2. Add Result(1) to the front of the scope chain.
3. Create a new Function object as specified in section 13.2
   with parameters specified by FormalParameterListopt
   and body specified by FunctionBody. Pass in the scope chain
   of the running execution context as the Scope.
4. Create a property in the object Result(1). The property's name is
   Identifier, value is Result(3), and attributes are{ DontDelete, ReadOnly }.
5. Remove Result(1) from the front of the scope chain.
6. Return Result(3).

NOTE The Identifier in a FunctionExpression can be referenced from
     inside the FunctionExpression's FunctionBody to allow the
     function to call itself recursively. However, unlike in a           
FunctionDeclaration, the Identifier in a FunctionExpression
     cannot be referenced from and does not affect the scope enclosing
     the FunctionExpression.
This is so an evangelism bug.

/be
gimme
Changing URL field back to original value and reassigning to Evangelism -
Assignee: shaver → momoi
Component: JavaScript Engine → English: Non-US
Product: Browser → Tech Evangelism
QA Contact: pschwartau → jonrubin
Version: other → unspecified
All yours.

What they have to do: remove the "void " prefix before a few "function"
definitions in their script.

What it will break: nothing.

What it will fix: Mozilla, Netscape 6.x, and any other ECMA-compliant browser.

The Air Canada site doesn't list an email contact, just a phone number (!), but
I hear from a friend that tried to complain to them that cyber@aircanada.ca is
the right place.  (He said they weren't really concerned, but he's no Bob
Clary.)  If that doesn't work, you might have to call the phone number.
Assignee: momoi → bclary
Keywords: 4xp, compat
Is there anything I need to do to get this started?  Every time I have to fire
up 4.x or IE to check the websavers, I die a little inside.
Not that this adds much info, but this problem or something similar seems to
affect nearly all of aircanada's site, as well as their discount brand Tango.

Here is another test URL:
http://www.flytango.com/en/

Many features of both websites use javascript to modify form options based on
other selections, not just websaver.  Mozilla is useless with either
aircanada.ca or flytango.com because of this.

I'm not experienced in evangelism, but I'm a regular Air Canada customer, I use
their website, and I live in Canada so if there's anything I can do to help,
drop me an email.
-> default owner
Assignee: bclary → momoi
QA Contact: jonrubin → jeesun
Summary: void function f() { } doesn't define function f → aircanada.ca - void function f() { } doesn't define function f
11 months later... the "void"s are gone. Retest?
OS: Linux → All
Hardware: PC → All
Whiteboard: [syntax-js]
Mass reassigning English-Other bugs to general default assignees.
Assignee: momoi → english-other
QA Contact: jeesun → english-other
WFM
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.