e4x/Expressions/11.1.4-08.js: inconsistencies in the use of {} syntax Part Deux

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
13 years ago
6 years ago

People

(Reporter: bc, Unassigned)

Tracking

Trunk
x86
All
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

13 years ago
continuation of bug 321549, bug 318922
(Reporter)

Comment 1

13 years ago
Created attachment 210598 [details]
shell script foo.js
(Reporter)

Comment 2

13 years ago
Created attachment 210599 [details]
shell script output foo.txt

Assuming I have the tests setup correctly, ...

50: FAIL expected: valid, actual: invalid
input: 
u='http://a.uri/';
p='p';
a=<a xmlns:p={u}>
  <{p}:b>x</p:b>
</a>;
output: 
SyntaxError: illegal XML character

51: FAIL expected: valid, actual: invalid
input: 
u='http://a.uri/';
p='p';
a=<a xmlns:pp={u}>
  <p{p}:b>x</pp:b>
</a>;
output: 
SyntaxError: illegal XML character

53: FAIL expected: valid, actual: invalid
input: 
u='http://a.uri/';
p='p';
ns="ns";
a=<a xml{ns}:pp={u}>
  <{p}p:b>x</pp:b>
</a>;
output: 
SyntaxError: illegal XML character

54: FAIL expected: valid, actual: invalid
input: 
u='http://a.uri/';
p='p';
ns="xmlns";
a=<a {ns}:pp={u}>
  <{p}p:b>x</pp:b>
</a>;
output: 
SyntaxError: illegal XML character

56: FAIL expected: valid, actual: invalid
input: 
u='http://a.uri/';
p='pp';
a=<a xmlns:pp={u}>
  <{p}:b>x</pp:b>
</a>;
output: 
SyntaxError: illegal XML character
(Reporter)

Comment 3

13 years ago
Checking in 11.1.4-08.js;
/cvsroot/mozilla/js/tests/e4x/Expressions/11.1.4-08.js,v  <--  11.1.4-08.js
initial revision: 1.1

If there are any errors in the test, let me know and I will fix them.

I also renamed the incorrectly named tests e4x/Expressions/11.4.1-0[1-7] to match the correct section 11.1.4.
Flags: testcase+
(Reporter)

Updated

13 years ago
Summary: E4X: inconsistencies in the use of {} syntax Part Deux → e4x/Expressions/11.1.4-08.js: inconsistencies in the use of {} syntax Part Deux
(In reply to comment #3)
> If there are any errors in the test, let me know and I will fix them.

At least according to the ECMA-357 ed. 2 I have, there seem to be at least 5-10 in here, judging by a scan through the FAILs from running the test.  I'll look through the list and try to find the errors when I next have time to do so; the fixes for those things don't look like they should be too difficult.
Assignee: general → jwalden+bmo
(Reporter)

Comment 5

12 years ago
Sections 50, 51, 53, 54, 56 are still failing. Shall I just remove them and invalidate this bug?

Updated

11 years ago
Blocks: 246441

Comment 6

11 years ago
(In reply to comment #2)
According to the E4X specs 2nd. ed., the following JS code should be correct, but currently is considered invalid by the parser. Tested in Firefox 2.0.0.14:

var attribs = 'a1="1" a2="2"';
var xml = <t {attribs}/>;

(However, the following works well:
var tag = 't a1="1" a2="2"';
var xml = <{tag}/>;
)

Comment 7

11 years ago
There are lots of inconsistencies in the E4X spec 2nd ed., so I'm not sure if the following should be a valid JS. Acording to the syntax in 11.1.4, it should not be valid, but on the other hand there's an example on p.44, which contradicts the syntax:

var a = "a";
var xml = <t {a}="1"/>;

Moreover, when literally following the syntax,

var a = "'1' b='2'";
var xml = <t a={a}/>;

is equivalent to

var xml = <t a='1' b='2'/>;

instead of what was probably meant:

var xml = <t a="'1' b='2'"/>;

The inconsistencies are surely bugs in the E4X spec. But does SpiderMonkey handle these cases the way they were intended? That's why I report them here. I don't know how to report the inconsistencies in the spec to ECMA, perhaps you will.
Assignee: jwalden+bmo → general
E4X will be removed again from Spidermonkey (bug 788293)
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.