mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
25 lines
589 B
TypeScript
25 lines
589 B
TypeScript
//// [tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment7.ts] ////
|
|
|
|
//// [destructuringObjectBindingPatternAndAssignment7.ts]
|
|
enum K {
|
|
a = "a",
|
|
b = "b"
|
|
}
|
|
const { [K.a]: aVal, [K.b]: bVal } = (() => {
|
|
return { [K.a]: 1, [K.b]: 1 };
|
|
})();
|
|
console.log(aVal, bVal);
|
|
|
|
|
|
//// [destructuringObjectBindingPatternAndAssignment7.js]
|
|
"use strict";
|
|
var K;
|
|
(function (K) {
|
|
K["a"] = "a";
|
|
K["b"] = "b";
|
|
})(K || (K = {}));
|
|
const { [K.a]: aVal, [K.b]: bVal } = (() => {
|
|
return { [K.a]: 1, [K.b]: 1 };
|
|
})();
|
|
console.log(aVal, bVal);
|