TypeScript/tests/baselines/reference/symbolProperty46.js
2015-02-06 21:32:54 -08:00

31 lines
671 B
JavaScript

//// [symbolProperty46.ts]
class C {
get [Symbol.hasInstance]() {
return "";
}
// Should take a string
set [Symbol.hasInstance](x) {
}
}
(new C)[Symbol.hasInstance] = 0;
(new C)[Symbol.hasInstance] = "";
//// [symbolProperty46.js]
var C = (function () {
function C() {
}
Object.defineProperty(C.prototype, Symbol.hasInstance, {
get: function () {
return "";
},
// Should take a string
set: function (x) {
},
enumerable: true,
configurable: true
});
return C;
})();
(new C)[Symbol.hasInstance] = 0;
(new C)[Symbol.hasInstance] = "";