Re: GJS internal linter
- From: Andrea Giammarchi <andrea giammarchi gmail com>
- To: Philip Chimento <philip chimento gmail com>
- Cc: javascript-list <javascript-list gnome org>
- Subject: Re: GJS internal linter
- Date: Sun, 10 Apr 2016 00:35:07 +0100
Hi Philip,
so ... one problem per time.
First one: how to drop lint warnings
trivial if you have an executable, like in my case. I'll use `
window.name` property since it's pointless to have `window` at all, generally speaking, but in GJS case is even more pointless to have a `
window.name` property.
Hack #1 is to drop `#!/usr/bin/env gjs` as executable header, and use the following instead:
```
#!/usr/bin/env bash
name=// GJS_DISABLE_EXTRA_WARNINGS=1 exec gjs "$0" "$@"
```
This seems to work like a charm in my case, please let me know if there's something that might go wrong.
Second problem: my `require("GObject")` is missing something, so I need to make it work as `imports.gi.GObject` does. I'm probaby ignoring, for some reason, `GObject.ParamSpec.uint`, or not attaching it to the `GObject.ParamSpec` object.
I need to solve this first before moving on.
Third problem: `new Lang.Class({Name: 'TimerLabel', Extends: Gtk.Label })`
There's something happening behind the `imports.lang` logic I might be able to either replicate or intercept overwriting `Object.getPrototypeOf` or other native methods.
I'm not sure it's possible, but I'm confident having a native polyfill/shim/sham/patcher included helps understanding transpiled code too.
After all, it's Babel, and what gets executed passes through what's available on GJS so yes, it might be superfluous, but I don't have a solution yet.
Thanks for taking time to answer, showing hints, and examples.
Best Regards
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]