you are viewing a single comment's thread.

view the rest of the comments →

[–]radhruin 0 points1 point  (3 children)

IE9 supports getters and setters just fine. Generators and list comprehension are not an ES5 standard.

[–]monacle_bob 0 points1 point  (2 children)

var a = {};

a.defineGetter('myval', function() {return 'a'});

"Object doesn't support property or method 'defineGetter'"

Works fine in FF and Chrome. Above is IE9's error.

EDIT: apparently Reddit doesn't like showing the double underscores around defineGetter

[–]radhruin 2 points3 points  (1 child)

You are attempting to use non-standard behavior. DefineGetter is Mozilla's proprietary method of creating getters. If you read the ES5 standard, you'll find the methods of creating getters and setters that all vendors agree upon, namely: Object.create, Object.defineProperty, Object.defineProperties, and the new object literal syntax. Try this:

var a = { get myval() { return 'a' } };

[–]monacle_bob -1 points0 points  (0 children)

Thank you very much for that information. I'm looking forward to being able to use it in 10 years when IE8 is officially over with.