mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
more node
This commit is contained in:
15
rootfs_overlay/lkmc/nodejs/static.js
Executable file
15
rootfs_overlay/lkmc/nodejs/static.js
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
class C {
|
||||
static f(i) {
|
||||
return i + 1;
|
||||
}
|
||||
g(i) {
|
||||
// https://stackoverflow.com/questions/19470559/how-to-access-static-member-on-instance
|
||||
return this.constructor.f(i) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
assert(new C().g(1) === 3);
|
||||
Reference in New Issue
Block a user