<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite>Hawk's W3 Laboratory : JavaScript Notes : JavaScript 深層 : スコープに関するその他の話題</cite> (<time>2009-01-04 11:50:22 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://web.archive.org/web/20061018193413/www.hawk.34sp.com/stdpls/jsnotes/jssinso/06_scope3.html">http://web.archive.org/web/20061018193413/www.hawk.34sp.com/stdpls/jsnotes/jssinso/06_scope3.html</anchor-external></p><blockquote><p>これは catch 節の開始時に e をプロパティとして持つオブジェクトが新規に作成され、スコープチェーンの先頭に加えられるからです。これによって、この例の &quot;e&quot; のような、例外処理のためだけの識別子が外側のスコープを汚染することが無くなります。だから次のコードはエラーになります。 </p><p>エラーになる……はずなのですが、実はIEの実装は手抜きで、catch内でも直前のスコープをそのまま使ってしまい、 e は直前の変数オブジェクトのプロパティとして扱われます。だからIEでこの例を実行した場合、普通に参照できてしまいます。</p><p>その他のOpera/Mozilla/KHTMLなどは仕様通りに動作します。 </p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite xml:lang="en">XProc 2.0: An XML Pipeline Language</cite>
(<time>2016-07-21 14:35:49 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://www.w3.org/TR/2016/NOTE-xproc20-20160721/#p.try">https://www.w3.org/TR/2016/NOTE-xproc20-20160721/#p.try</anchor-external></p></section></body></html>