From fc236ec0b228d00e9bcd0ac7a63b23a4099304f0 Mon Sep 17 00:00:00 2001 From: joeduffy Date: Tue, 5 Sep 2017 15:51:05 -0700 Subject: [PATCH] Override toString from Property This is mostly just for debugging purposes, but hopefully makes it a little clearer that you've done something wrong, vs "[object Object]". --- sdk/nodejs/runtime/property.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/nodejs/runtime/property.ts b/sdk/nodejs/runtime/property.ts index ba415e3d2..542b0591f 100644 --- a/sdk/nodejs/runtime/property.ts +++ b/sdk/nodejs/runtime/property.ts @@ -92,6 +92,14 @@ export class Property implements Computed { } } + // toString overrides the standard toString to provide a "helpful" message. Most likely this was a mistake, + // and perhaps the message will help to indicate this, although sometimes it is helpful. + public toString(): string { + return `[pulumi-fabric Property: ` + + `input=${this.input} output=${this.output} ` + + `resolved=${this.resolveOutput === undefined}]`; + } + // setInput resolves the initial input value of a property. private setInput(value: T | undefined): void { if (this.resolveInput === undefined) {