mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
35 lines
706 B
TypeScript
35 lines
706 B
TypeScript
//// [tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts] ////
|
|
|
|
//// [declFileObjectLiteralWithOnlySetter.ts]
|
|
function /*1*/makePoint(x: number) {
|
|
return {
|
|
b: 10,
|
|
set x(a: number) { this.b = a; }
|
|
};
|
|
};
|
|
var /*3*/point = makePoint(2);
|
|
point./*2*/x = 30;
|
|
|
|
//// [declFileObjectLiteralWithOnlySetter.js]
|
|
"use strict";
|
|
function makePoint(x) {
|
|
return {
|
|
b: 10,
|
|
set x(a) { this.b = a; }
|
|
};
|
|
}
|
|
;
|
|
var /*3*/ point = makePoint(2);
|
|
point. /*2*/x = 30;
|
|
|
|
|
|
//// [declFileObjectLiteralWithOnlySetter.d.ts]
|
|
declare function makePoint(x: number): {
|
|
b: number;
|
|
x: number;
|
|
};
|
|
declare var /*3*/ point: {
|
|
b: number;
|
|
x: number;
|
|
};
|