swc/tests/tsc-references/es6/Symbols/symbolProperty56/input.ts/es5.1.normal/output.js

25 lines
687 B
JavaScript

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
//@target: ES6
var obj = _defineProperty({
}, Symbol.iterator, 0);
var M;
(function(M) {
var Symbol;
// The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator,
// the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol.
obj[Symbol["iterator"]];
})(M || (M = {
}));