restructure test directory
This commit is contained in:
26
test/fixtures/syntax/classes/accessing-super-class/actual.js
vendored
Normal file
26
test/fixtures/syntax/classes/accessing-super-class/actual.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
class Test extends Foo {
|
||||
constructor() {
|
||||
woops.super.test();
|
||||
super();
|
||||
super.test();
|
||||
foob(super);
|
||||
|
||||
super(...arguments);
|
||||
super("test", ...arguments);
|
||||
|
||||
super.test(...arguments);
|
||||
super.test("test", ...arguments);
|
||||
}
|
||||
|
||||
test() {
|
||||
super();
|
||||
super(...arguments);
|
||||
super("test", ...arguments);
|
||||
}
|
||||
|
||||
static foo() {
|
||||
super();
|
||||
super(...arguments);
|
||||
super("test", ...arguments);
|
||||
}
|
||||
}
|
||||
57
test/fixtures/syntax/classes/accessing-super-class/expected.js
vendored
Normal file
57
test/fixtures/syntax/classes/accessing-super-class/expected.js
vendored
Normal file
@@ -0,0 +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
|
||||
}
|
||||
});
|
||||
|
||||
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);
|
||||
6
test/fixtures/syntax/classes/accessing-super-properties/actual.js
vendored
Normal file
6
test/fixtures/syntax/classes/accessing-super-properties/actual.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
class Test extends Foo {
|
||||
constructor() {
|
||||
super.test;
|
||||
super.test.whatever;
|
||||
}
|
||||
}
|
||||
18
test/fixtures/syntax/classes/accessing-super-properties/expected.js
vendored
Normal file
18
test/fixtures/syntax/classes/accessing-super-properties/expected.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
var Test = function(Foo) {
|
||||
function Test() {
|
||||
Foo.prototype.test;
|
||||
Foo.prototype.test.whatever;
|
||||
}
|
||||
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
value: Test,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
Test.__proto__ = Foo;
|
||||
return Test;
|
||||
}(Foo);
|
||||
6
test/fixtures/syntax/classes/calling-super-properties/actual.js
vendored
Normal file
6
test/fixtures/syntax/classes/calling-super-properties/actual.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
class Test extends Foo {
|
||||
constructor() {
|
||||
super.test.whatever();
|
||||
super.test();
|
||||
}
|
||||
}
|
||||
16
test/fixtures/syntax/classes/calling-super-properties/expected.js
vendored
Normal file
16
test/fixtures/syntax/classes/calling-super-properties/expected.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
var Test = function(Foo) {
|
||||
function Test() {
|
||||
Foo.prototype.test.whatever();
|
||||
Foo.prototype.test.call(this);
|
||||
}
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
value: Test,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
Test.__proto__ = Foo;
|
||||
return Test;
|
||||
}(Foo);
|
||||
11
test/fixtures/syntax/classes/constructor/actual.js
vendored
Normal file
11
test/fixtures/syntax/classes/constructor/actual.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
constructor() {
|
||||
this.state = "test";
|
||||
}
|
||||
}
|
||||
|
||||
class Foo extends Bar {
|
||||
constructor() {
|
||||
this.state = "test";
|
||||
}
|
||||
}
|
||||
24
test/fixtures/syntax/classes/constructor/expected.js
vendored
Normal file
24
test/fixtures/syntax/classes/constructor/expected.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
this.state = "test";
|
||||
}
|
||||
return Test;
|
||||
}();
|
||||
|
||||
var Foo = function(Bar) {
|
||||
function Foo() {
|
||||
this.state = "test";
|
||||
}
|
||||
|
||||
Foo.prototype = Object.create(Bar.prototype, {
|
||||
constructor: {
|
||||
value: Foo,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
|
||||
Foo.__proto__ = Bar;
|
||||
return Foo;
|
||||
}(Bar);
|
||||
4
test/fixtures/syntax/classes/defining-constructor-as-a-mutator/actual.js
vendored
Normal file
4
test/fixtures/syntax/classes/defining-constructor-as-a-mutator/actual.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
class Test {
|
||||
get constructor() {
|
||||
}
|
||||
}
|
||||
3
test/fixtures/syntax/classes/defining-constructor-as-a-mutator/options.json
vendored
Normal file
3
test/fixtures/syntax/classes/defining-constructor-as-a-mutator/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "unknown kind for constructor method"
|
||||
}
|
||||
8
test/fixtures/syntax/classes/instance-getter-and-setter/actual.js
vendored
Normal file
8
test/fixtures/syntax/classes/instance-getter-and-setter/actual.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
get test() {
|
||||
return 5 + 5;
|
||||
}
|
||||
set test(val) {
|
||||
this._test = val;
|
||||
}
|
||||
}
|
||||
15
test/fixtures/syntax/classes/instance-getter-and-setter/expected.js
vendored
Normal file
15
test/fixtures/syntax/classes/instance-getter-and-setter/expected.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
}
|
||||
Object.defineProperties(Test.prototype, {
|
||||
test: {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
},
|
||||
set: function (val) {
|
||||
this._test = val;
|
||||
}
|
||||
}
|
||||
});
|
||||
return Test;
|
||||
}();
|
||||
5
test/fixtures/syntax/classes/instance-getter/actual.js
vendored
Normal file
5
test/fixtures/syntax/classes/instance-getter/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
get test() {
|
||||
return 5 + 5;
|
||||
}
|
||||
}
|
||||
12
test/fixtures/syntax/classes/instance-getter/expected.js
vendored
Normal file
12
test/fixtures/syntax/classes/instance-getter/expected.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
}
|
||||
Object.defineProperties(Test.prototype, {
|
||||
test: {
|
||||
get: function () {
|
||||
return 5 + 5;
|
||||
}
|
||||
}
|
||||
});
|
||||
return Test;
|
||||
}();
|
||||
5
test/fixtures/syntax/classes/instance-method/actual.js
vendored
Normal file
5
test/fixtures/syntax/classes/instance-method/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
test() {
|
||||
return 5 + 5;
|
||||
}
|
||||
}
|
||||
13
test/fixtures/syntax/classes/instance-method/expected.js
vendored
Normal file
13
test/fixtures/syntax/classes/instance-method/expected.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
}
|
||||
Object.defineProperties(Test.prototype, {
|
||||
test: {
|
||||
writeable: true,
|
||||
value: function () {
|
||||
return 5 + 5;
|
||||
}
|
||||
}
|
||||
});
|
||||
return Test;
|
||||
}();
|
||||
5
test/fixtures/syntax/classes/instance-setter/actual.js
vendored
Normal file
5
test/fixtures/syntax/classes/instance-setter/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
set test(val) {
|
||||
this._test = val;
|
||||
}
|
||||
}
|
||||
12
test/fixtures/syntax/classes/instance-setter/expected.js
vendored
Normal file
12
test/fixtures/syntax/classes/instance-setter/expected.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
}
|
||||
Object.defineProperties(Test.prototype, {
|
||||
test: {
|
||||
set: function (val) {
|
||||
this._test = val;
|
||||
}
|
||||
}
|
||||
});
|
||||
return Test;
|
||||
}();
|
||||
1
test/fixtures/syntax/classes/plain-class/actual.js
vendored
Normal file
1
test/fixtures/syntax/classes/plain-class/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
class Test { }
|
||||
5
test/fixtures/syntax/classes/plain-class/expected.js
vendored
Normal file
5
test/fixtures/syntax/classes/plain-class/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
}
|
||||
return Test;
|
||||
}();
|
||||
7
test/fixtures/syntax/classes/statement/actual.js
vendored
Normal file
7
test/fixtures/syntax/classes/statement/actual.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var BaseView = class BaseView {
|
||||
constructor() {
|
||||
this.autoRender = true;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BaseView;
|
||||
9
test/fixtures/syntax/classes/statement/expected.js
vendored
Normal file
9
test/fixtures/syntax/classes/statement/expected.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var BaseView = function () {
|
||||
function BaseView() {
|
||||
this.autoRender = true;
|
||||
}
|
||||
|
||||
return BaseView;
|
||||
}();
|
||||
|
||||
module.exports = BaseView;
|
||||
13
test/fixtures/syntax/classes/static/actual.js
vendored
Normal file
13
test/fixtures/syntax/classes/static/actual.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
class A {
|
||||
static a() {
|
||||
|
||||
}
|
||||
|
||||
static get b(){
|
||||
|
||||
}
|
||||
|
||||
static set b(b){
|
||||
|
||||
}
|
||||
}
|
||||
17
test/fixtures/syntax/classes/static/expected.js
vendored
Normal file
17
test/fixtures/syntax/classes/static/expected.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
var A = function() {
|
||||
function A() {}
|
||||
|
||||
Object.defineProperties(A, {
|
||||
a: {
|
||||
writeable: true,
|
||||
value: function() {}
|
||||
},
|
||||
|
||||
b: {
|
||||
get: function() {},
|
||||
set: function(b) {}
|
||||
}
|
||||
});
|
||||
|
||||
return A;
|
||||
}();
|
||||
7
test/fixtures/syntax/classes/super-class-member-expression/actual.js
vendored
Normal file
7
test/fixtures/syntax/classes/super-class-member-expression/actual.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
class BaseController extends Chaplin.Controller {
|
||||
|
||||
}
|
||||
|
||||
class BaseController2 extends Chaplin.Controller.Another {
|
||||
|
||||
}
|
||||
31
test/fixtures/syntax/classes/super-class-member-expression/expected.js
vendored
Normal file
31
test/fixtures/syntax/classes/super-class-member-expression/expected.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
var BaseController = function (Chaplin) {
|
||||
function BaseController() {
|
||||
Chaplin.Controller.apply(this, arguments);
|
||||
}
|
||||
BaseController.prototype = Object.create(Chaplin.Controller.prototype, {
|
||||
constructor: {
|
||||
value: BaseController,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
BaseController.__proto__ = Chaplin.Controller;
|
||||
return BaseController;
|
||||
}(Chaplin);
|
||||
|
||||
var BaseController2 = function (Chaplin) {
|
||||
function BaseController2() {
|
||||
Chaplin.Controller.Another.apply(this, arguments);
|
||||
}
|
||||
BaseController2.prototype = Object.create(Chaplin.Controller.Another.prototype, {
|
||||
constructor: {
|
||||
value: BaseController2,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
BaseController2.__proto__ = Chaplin.Controller.Another;
|
||||
return BaseController2;
|
||||
}(Chaplin);
|
||||
3
test/fixtures/syntax/classes/super-class-non-identifiers/actual.js
vendored
Normal file
3
test/fixtures/syntax/classes/super-class-non-identifiers/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
class Q extends function() {} {
|
||||
|
||||
}
|
||||
17
test/fixtures/syntax/classes/super-class-non-identifiers/expected.js
vendored
Normal file
17
test/fixtures/syntax/classes/super-class-non-identifiers/expected.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
var Q = function(_ref) {
|
||||
function Q() {
|
||||
_ref.apply(this, arguments);
|
||||
}
|
||||
|
||||
Q.prototype = Object.create(_ref.prototype, {
|
||||
constructor: {
|
||||
value: Q,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
Q.__proto__ = _ref;
|
||||
|
||||
return Q;
|
||||
}(function() {});
|
||||
1
test/fixtures/syntax/classes/super-class/actual.js
vendored
Normal file
1
test/fixtures/syntax/classes/super-class/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
class Test extends Foo { }
|
||||
15
test/fixtures/syntax/classes/super-class/expected.js
vendored
Normal file
15
test/fixtures/syntax/classes/super-class/expected.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var Test = function (Foo) {
|
||||
function Test() {
|
||||
Foo.apply(this, arguments);
|
||||
}
|
||||
Test.prototype = Object.create(Foo.prototype, {
|
||||
constructor: {
|
||||
value: Test,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
Test.__proto__ = Foo;
|
||||
return Test;
|
||||
}(Foo);
|
||||
5
test/fixtures/syntax/classes/super-fallback/actual.js
vendored
Normal file
5
test/fixtures/syntax/classes/super-fallback/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
constructor() {
|
||||
super.hasOwnProperty("test");
|
||||
}
|
||||
}
|
||||
6
test/fixtures/syntax/classes/super-fallback/expected.js
vendored
Normal file
6
test/fixtures/syntax/classes/super-fallback/expected.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
var Test = function () {
|
||||
function Test() {
|
||||
Function.prototype.hasOwnProperty.call(this, "test");
|
||||
}
|
||||
return Test;
|
||||
}();
|
||||
Reference in New Issue
Block a user