make class methods unenumerable - fixes #41
This commit is contained in:
@@ -1,38 +1,57 @@
|
||||
var Test = function (Foo) {
|
||||
function Test() {
|
||||
woops.super.test();
|
||||
Foo.call(this);
|
||||
Foo.prototype.test.call(this);
|
||||
foob(Foo);
|
||||
Foo.call.apply(Foo, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.call.apply(Foo, [this, "test"].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(Foo.prototype, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(
|
||||
Foo.prototype,
|
||||
[this, "test"].concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
}
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
value: Test,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
var Test = function(Foo) {
|
||||
function Test() {
|
||||
woops.super.test();
|
||||
Foo.call(this);
|
||||
Foo.prototype.test.call(this);
|
||||
foob(Foo);
|
||||
Foo.call.apply(Foo, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.call.apply(Foo, [this, "test"].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(Foo.prototype, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
|
||||
Foo.prototype.test.call.apply(
|
||||
Foo.prototype,
|
||||
[this, "test"].concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
}
|
||||
});
|
||||
Test.__proto__ = Foo;
|
||||
Test.prototype.test = function () {
|
||||
Foo.prototype.test.call(this);
|
||||
Foo.prototype.test.call.apply(Foo.prototype.test, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.prototype.test.call.apply(
|
||||
Foo.prototype.test,
|
||||
[this, "test"].concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
};
|
||||
Test.foo = function () {
|
||||
Foo.foo.call(this);
|
||||
Foo.foo.call.apply(Foo.foo, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
return Test;
|
||||
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
value: Test,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
Test.__proto__ = Foo;
|
||||
|
||||
Object.defineProperties(Test.prototype, {
|
||||
test: {
|
||||
writeable: true,
|
||||
|
||||
value: function() {
|
||||
Foo.prototype.test.call(this);
|
||||
Foo.prototype.test.call.apply(Foo.prototype.test, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
|
||||
Foo.prototype.test.call.apply(
|
||||
Foo.prototype.test,
|
||||
[this, "test"].concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperties(Test, {
|
||||
foo: {
|
||||
writeable: true,
|
||||
|
||||
value: function() {
|
||||
Foo.foo.call(this);
|
||||
Foo.foo.call.apply(Foo.foo, [this].concat(Array.prototype.slice.call(arguments)));
|
||||
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(Array.prototype.slice.call(arguments)));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return Test;
|
||||
}(Foo);
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
}
|
||||
Test.prototype.test = function () {
|
||||
return 5 + 5;
|
||||
};
|
||||
Object.defineProperties(Test.prototype, {
|
||||
test: {
|
||||
writeable: true,
|
||||
value: function () {
|
||||
return 5 + 5;
|
||||
}
|
||||
}
|
||||
});
|
||||
return Test;
|
||||
}();
|
||||
|
||||
7
test/fixtures/classes/static/expected.js
vendored
7
test/fixtures/classes/static/expected.js
vendored
@@ -1,9 +1,12 @@
|
||||
var A = function() {
|
||||
function A() {}
|
||||
|
||||
A.a = function() {};
|
||||
|
||||
Object.defineProperties(A, {
|
||||
a: {
|
||||
writeable: true,
|
||||
value: function() {}
|
||||
},
|
||||
|
||||
b: {
|
||||
get: function() {},
|
||||
set: function(b) {}
|
||||
|
||||
Reference in New Issue
Block a user