mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
16 lines
278 B
JavaScript
Executable File
16 lines
278 B
JavaScript
Executable File
#!/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);
|