[ASC BUG] Must allow the use of "undefined" in more contexts

VERIFIED FIXED in Q2 12 - Cyril

Status

Tamarin
Tools
P2
normal
VERIFIED FIXED
7 years ago
7 years ago

People

(Reporter: Lars T Hansen, Assigned: Lars T Hansen)

Tracking

(Blocks: 1 bug)

unspecified
Q2 12 - Cyril
x86
Mac OS X
Bug Flags:
in-testsuite +

Details

(Assignee)

Description

7 years ago
The fix for bug #706469 made undefined values visible more generally by constant-expression-evaluating the expression "undefined".  It turns out that undefined is used broadly to generate default values, for comparisons, and so on, even in contexts where it is not very sensible to do so (eg comparing it to Object values), ie, it is used synonymously with null and 0 and false.

In default value and initialization contexts we allow such usage through checkDefaultValue() but in other contexts we use coerce(), which is stricter.  It is not desirable to have two different rules, and it is not desirable to break a bunch of programs.  Hence it is probably the case that coerce() should allow the conversion of undefined values to other types (and ideally ASC should perform such conversions at compile time, of course).
(Assignee)

Comment 1

7 years ago
changeset:   76:55c204c71b8c
tag:         tip
user:        Lars T Hansen <lhansen@adobe.com>
date:        Mon Dec 05 16:37:36 2011 +0100
summary:     Allow undefined to be coerced to all other types in coerce()
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Assignee)

Comment 2

7 years ago
Reopening; I did test it but there are cases that are not working properly.  Inexplicably we still see an error here:

  function f(o:Object = undefined)
  {
    if (o == undefined)
      print("Ho");
  }
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 3

7 years ago
changeset:   78:fcbc9c325af9
tag:         tip
user:        Lars T Hansen <lhansen@adobe.com>
date:        Tue Dec 06 15:54:36 2011 +0100
summary:     Fix several bugs (unavailable atm due to bugzilla downage), dealing with comparison with undefined and mixed math with float4 as one operand, all in strict mode.
Status: REOPENED → RESOLVED
Last Resolved: 7 years ago7 years ago
Resolution: --- → FIXED

Comment 4

7 years ago
testmedia landed with:
changeset:   7035:9dde02afd510
user:        Lars T Hansen <lhansen@adobe.com>
date:        Tue Dec 06 15:56:22 2011 +0100
summary:     Updated asc.jar to 78:fcbc9c325af9, added several asc regression tests in as3/asc.
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.