return Object.defineProperties without a closure in property methods assignment unless it's really necessary
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function (_obj) {
|
||||
Object.defineProperties(_obj, {
|
||||
foo: {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
set: function (value) {
|
||||
this._foo = value;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
|
||||
return _obj;
|
||||
})({});
|
||||
var obj = Object.defineProperties({}, {
|
||||
foo: {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
set: function (value) {
|
||||
this._foo = value;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function (_obj) {
|
||||
Object.defineProperties(_obj, {
|
||||
foo: {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
|
||||
return _obj;
|
||||
})({});
|
||||
var obj = Object.defineProperties({}, {
|
||||
foo: {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var obj = (function (_obj) {
|
||||
Object.defineProperties(_obj, {
|
||||
foo: {
|
||||
set: function (value) {
|
||||
this._foo = value;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
|
||||
return _obj;
|
||||
})({});
|
||||
var obj = Object.defineProperties({}, {
|
||||
foo: {
|
||||
set: function (value) {
|
||||
this._foo = value;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user