kartoffelsup
03/30/2020, 7:58 PMLogan Knight
03/30/2020, 8:02 PM@file:JsModule("name-of-module")
at the top of the definition file?Logan Knight
03/30/2020, 8:03 PMkartoffelsup
03/30/2020, 8:04 PMkartoffelsup
03/30/2020, 8:04 PMLogan Knight
03/30/2020, 8:04 PMkartoffelsup
03/30/2020, 8:13 PMkartoffelsup
03/30/2020, 8:57 PMbashor
03/31/2020, 1:17 PM[JB] Shagen
03/31/2020, 1:25 PMkartoffelsup
03/31/2020, 7:49 PMclass CdkTestStack constructor(val scope: Construct, val id: String) : Stack(scope, id) {
init {
val lambda = Function(this, "TestLambda", object : FunctionProps {
override var runtime: Runtime = Runtime.NODEJS_12_X
override var code: Code = Code.fromInline("")
override var handler: String = "index.handler"
})
}
}
fun main() {
val app = App()
CdkTestStack(app, "CdkTestStack")
}
Gets compiled to:
...
var App = $module$<http://_aws_cdk_core.App|_aws_cdk_core.App>;
CdkTestStack.prototype = Object.create(Stack.prototype);
CdkTestStack.prototype.constructor = CdkTestStack;
function CdkTestStack(scope, id) {
Stack.call(this, scope, id);
this.scope = scope;
this.id = id;
var lambda = new Function(this, 'TestLambda', new CdkTestStack_init$ObjectLiteral());
}
...
and cdk/node complains that
Stack.call(this, scope, id);
^
TypeError: Class constructor Stack cannot be invoked without 'new'
at new CdkTestStack (/home/arml/dev/lib/kt-js-lambda-test/build/js/packages/kt-js-lambda-test-kt-cdk/kotlin/kt-js-lambda-test-kt-cdk.js:9:11)
is there a way to make this work?[JB] Shagen
03/31/2020, 10:34 PMkartoffelsup
04/01/2020, 9:32 AM[JB] Shagen
04/01/2020, 10:37 AMkartoffelsup
04/01/2020, 11:18 AMkartoffelsup
04/02/2020, 6:38 PM