Ticket #63 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

Global assignment and 'var' introduce bindings in different namespaces

Reported by: lth Assigned to: graydon
Type: defect Priority: major
Milestone: M0 Component: RefImpl
Version: 4 Keywords:
Cc: jeffdyer

Description

The smoking gun:

>> :reboot
>> u = 37
37
>> var u = 10
>> u
**ERROR** NameError: ambiguous reference  (near <no filename>:1.2-1.1)

The problem can be seen by the use of intrinsic::inspect(this):

  prop = [ns public '']::u : * = 37
  prop = [ns internal '']::u : * (DD,FX)  = 10

The assignment creates a binding in the public namespace, but var uses the internal namespace. Confusion ensues (and one string test crashes).

Attachments

Change History

  Changed 2 years ago by lth

BTW the failing test is ecma/String/15.5.4.12-3.js; I've added a definition of the variable at the top in an attempt to work around the problem.

follow-up: ↓ 3   Changed 2 years ago by jeffdyer

See #33 for more discussion.

Both u = 37 and var u = 10 need to create a property whose name is in "no namespace".

in reply to: ↑ 2   Changed 2 years ago by jeffdyer

Replying to jeffdyer:

See #33 for more discussion. Both u = 37 and var u = 10 need to create a property whose name is in "no namespace".

Actually, they need to create names in the namespace Public "". This is equivalent to "no namespace".

  Changed 2 years ago by graydon

  • status changed from new to closed
  • resolution set to duplicate

Should be corrected with fix to #33, it's the same bug.

Note: See TracTickets for help on using tickets.