Add several test cases for systemjs exports (#5954)
This commit is contained in:
parent
d82afb407e
commit
e919c6e6eb
@ -0,0 +1 @@
|
||||
export const [foo, bar = 2] = [];
|
||||
@ -0,0 +1,14 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const [foo, bar = 2] = [];
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
export const [foo, bar, ...baz] = [];
|
||||
@ -0,0 +1,16 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const [foo, bar, ...baz] = [];
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
|
||||
_export("baz", baz);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
export const [foo, bar] = [];
|
||||
@ -0,0 +1,14 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const [foo, bar] = [];
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
export const { foo: { bar: [baz, qux] } } = {};
|
||||
@ -0,0 +1,18 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo: {
|
||||
bar: [baz, qux]
|
||||
}
|
||||
} = {};
|
||||
|
||||
_export("baz", baz);
|
||||
|
||||
_export("qux", qux);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
export const { foo, bar = 1 } = {};
|
||||
@ -0,0 +1,17 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo,
|
||||
bar = 1
|
||||
} = {};
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
export const { foo, ...bar } = {};
|
||||
@ -0,0 +1,17 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo,
|
||||
...bar
|
||||
} = {};
|
||||
|
||||
_export("foo", foo);
|
||||
|
||||
_export("bar", bar);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-es2015-modules-systemjs", "syntax-object-rest-spread"]
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
export const { foo: bar, baz } = {};
|
||||
@ -0,0 +1,17 @@
|
||||
System.register([], function (_export, _context) {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
const {
|
||||
foo: bar,
|
||||
baz
|
||||
} = {};
|
||||
|
||||
_export("bar", bar);
|
||||
|
||||
_export("baz", baz);
|
||||
}
|
||||
};
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user