代码拉取完成,页面将自动刷新
let A: Number = 1.0
interface I {
// abstract method
foo(p: Number): Number;
// default method
bar(p: Number): Number {
return p * 4.0;
}
// static method
static baz(): Number {
return A * 10.0;
}
}
class C implements I {
fld1: Number;
fld2: Number;
// overridden interface method
public override foo(p: Number): Number {
this.fld1 = p;
this.fld2 = this.fld1 * 2;
return this.fld2;
}
}
function main_run(): void {
let c: C = new C();
assert c.foo(2.0) == 4.0
assert c.bar(2.0) == 8.0
assert I.baz() == 10.0
// module level scope is not affected
assert A == 1.0
}
function main() {
for (let i = 0; i < 5000; i++) {
main_run()
}
}
Run this sample:
$ bin/es2panda --thread=0 --opt-level=2 --extension=ets --gen-stdlib=false --output=/tmp/sample.abc sample.ets
$ bin/ark --boot-panda-files=$PWD/plugins/ets/etsstdlib.abc --load-runtimes=ets --compiler-enable-jit=true /tmp/sample.abc ETSGLOBAL::main
ASSERTION FAILED: daemon_threads_cnt_ > 0 || mem_stats_s_->GetFootprint(SpaceType::SPACE_TYPE_INTERNAL) == 0
IN /home/vkopyl/arkcompiler_runtime_core/runtime/runtime.cpp:127: Destroy
ERRNO: 12 (Cannot allocate memory)
Backtrace [tid=1938658]:
#0 : 0x7fcabfc8afaa [TID 1d94e2] E/runtime: libdwarf error: DW_DLE_FIRST_DIE_NOT_CU (105)
[TID 1d94e2] E/runtime: libdwarf error: DW_DLE_FIRST_DIE_NOT_CU (105)
panda::Runtime::Destroy()+0x24a
#1 : 0x10001b011 panda::Main(int, char const**)+0x12a1
#2 : 0x7fcabe18c083 __libc_start_main+0xf3
#3 : 0x1000173fe _start+0x2e
.
.
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 @godmiaozi @peijiajun @Ishin Pavel @Vyacheslav Cherkashin 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer @godmiaozi @peijiajun @Ishin Pavel @Vyacheslav Cherkashin for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论