mirror of
https://github.com/swc-project/swc.git
synced 2025-01-03 11:01:52 +03:00
25 lines
687 B
JavaScript
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 = {
|
|
}));
|