Another namespace question

# Michael O'Brien (18 years ago)

Where can you put a "use namespace" directive ?

The RI seems to insist that it only be at the top of a package:

See:

package { namespace blue }

package { use namespace blue // OK here

var y

use namespace blue		//	Fails here


blue var x = 1
print(x)

}

Could not a "use namespace" directive be anywhere in a block and then apply to that entire block scope. Just like a variable declaration. If so, then what happens if multiple use namespace directives exist in a single block scope?

Michael

# Graydon Hoare (18 years ago)

Michael O'Brien wrote:

Could not a "use namespace" directive be anywhere in a block and then apply to that entire block scope. Just like a variable declaration. If so, then what happens if multiple use namespace directives exist in a single block scope?

The behavior of the RI in this regard currently reflects an outdated consensus the committee held in the past. It has not been modified since then due to ongoing discussion of the matter. When consensus (re-)emerges, I'll update the RI.

You can track this issue in bugs.ecmascript.org/ticket/282