memo_sample_spannerにzaganeをかけてチェックをしたときの話
zaganeはCloud Spannerの使用しているプロジェクト内の下記の処理漏れを検知してくれるツール
- ReadOnlyTransactionのClose漏れ
- 検索結果のiteretorのClose漏れ
- (ReadWreteTransaction内でのWrapError検知 ※解決済)
memo_sample_spannerにzaganeをかけてチェックをしたときの話
zaganeはCloud Spannerの使用しているプロジェクト内の下記の処理漏れを検知してくれるツール
| ,_---~~~~~----._ | |
| _,,_,*^____ _____``*g*\"*, | |
| / __/ /' ^. / \ ^@q f | |
| [ @f | @)) | | @)) l 0 _/ | |
| \`/ \~____ / __ \_____/ \ | |
| | _l__l_ I | |
| } [______] I | |
| ] | | | | | |
| ] ~ ~ | | |
| | | |
| package main | |
| import "os" | |
| func main() { | |
| if len(os.Args) < 2 { | |
| println("usage: %s program arg1 arg2 ...", os.Args[0]) | |
| return | |
| } |
| package main | |
| import ( | |
| "fmt" | |
| "unsafe" | |
| ) | |
| /* | |
| void modifyN(void* p, int n) { | |
| *(int *)p = n; |
| (ns tapl.core | |
| (:require [instaparse.core :as insta])) | |
| (def my-parser | |
| (insta/parser | |
| "<T> := 'true' | 'false' | '0' | | |
| 'succ'<space>T | 'pred'<space>T | 'iszero'<space>T | | |
| 'if'<space>T<space>'then'<space>T<space>'else'<space>T; | |
| space := #'\\s';")) |
#WebComponents
Mozillaが先日WebComponents系のdocument.registerを[Bug783129]で実装した。
使用するには、about:config 等から dom.webcomponents.enabled を true にする必要がある。
##カスタム要素は "x-" から始まっているべきか
テストコードを書いていて気付いたのだが、Mozillaの実装では document.registerの第一引数のタグ名が x- から始まっていないと InvalidCharacterError の例外が発生する。実際にコードもそのものずばりで書かれてある。
しかし、[CustomElements]、custom element nameの項を見ると、以下のように書かれており、-(ハイフン)は必要だと書いているが x- である必要性は説いていない。