Skip to content
This repository

Unimplemented Features Error #1

Closed
jangaroo opened this Issue March 21, 2010 · 4 comments

2 participants

Jangaroo AS3 w/o Flash Eli Grey
Jangaroo AS3 w/o Flash

Currently, if any of the unimplemented features "writable", "enumerable" or "configurable" is set to true, an error is thrown.

// can't implement these features so throw a RangeError if any are true
if (descriptor.writable || descriptor.enumerable || descriptor.configurable) {
  throw new RangeError("This implementation of Object.defineProperty does not support configurable, enumerable, or writable.");
}

Since all user-defined properties in ECMAScript 3 are in fact writable, enumerable, and configurable, I think it makes more sense to throw an error if any configuration attribute is explicitly set to false:

// can't switch off these features in ECMAScript 3 so throw a RangeError if any are false
if (descriptor.writable===false || descriptor.enumerable===false || descriptor.configurable===false) {
  throw new RangeError("This implementation of Object.defineProperty does not support to switch off configurable, enumerable, or writable.");
}
Eli Grey
Owner

Ah, yeah I should have done that instead. Also, technically, enumerable can be implemented with __iterator__ hacks and I may make a separate library for that.

Jangaroo AS3 w/o Flash

Didn't know about iterator! Which browsers / JS engines support that? (Firefox hit: https://developer-stage.mozilla.org/en/Core_JavaScript_1.5_Guide/Iterators_and_Generators)
Btw., I added some background information to the project Wiki homepage.

Eli Grey
Owner

Thanks for the background info. All official JavaScript engines by Mozilla support iterators and generators. I've never used ActionScript, but I think it may also implement it as there was stuff about iterators and generators in ECMAScript 4.

Eli Grey
Owner
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.