Add several test cases for systemjs exports (#5954)

This commit is contained in:
Justin Ridgewell 2017-07-17 09:51:37 -04:00 committed by Brian Ng
parent d82afb407e
commit e919c6e6eb
15 changed files with 123 additions and 0 deletions

View File

@ -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);
}
};
});

View File

@ -0,0 +1 @@
export const [foo, bar, ...baz] = [];

View File

@ -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);
}
};
});

View File

@ -0,0 +1,14 @@
System.register([], function (_export, _context) {
"use strict";
return {
setters: [],
execute: function () {
const [foo, bar] = [];
_export("foo", foo);
_export("bar", bar);
}
};
});

View File

@ -0,0 +1 @@
export const { foo: { bar: [baz, qux] } } = {};

View File

@ -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);
}
};
});

View File

@ -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);
}
};
});

View File

@ -0,0 +1,17 @@
System.register([], function (_export, _context) {
"use strict";
return {
setters: [],
execute: function () {
const {
foo,
...bar
} = {};
_export("foo", foo);
_export("bar", bar);
}
};
});

View File

@ -0,0 +1,3 @@
{
"plugins": ["external-helpers", "transform-es2015-modules-systemjs", "syntax-object-rest-spread"]
}

View File

@ -0,0 +1 @@
export const { foo: bar, baz } = {};

View File

@ -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);
}
};
});