Javascript weirdness? - Google グループ var o1 = [], f1 = function(){ return o1; }; (new f1()) === o1; // true var o2 = 1, f2 = function(){ return o2; }; (new f2()) === o2; // false これってどういうことだってばよ? という話。例によって仕様…
もの凄く基本的なことなんだけど、忘れて Google 先生のお世話になることが多いのでメモっておくコマンドラインからだったら、 open -a Firefox --args -P profileName -no-remote でOKだが、いちいちコマンドラインから起動するのは面倒なこともあって、自…
Google Chromeに入ったジェネレータとPromiseで非同期処理に革命が起きた - 素人がプログラミングを勉強していたブログ javascripter さんの記事ではPromise実装としてjQueryのを使用しているけど、Fx では DOM Promise が使えるので、それに合わせて書きな…
ちょっと前に、Generator のプロトタイプ で書いたが、function * () { yield ...; } な構文が導入された。また、最近ユーザ作成の Generator.next() が { done: Boolean, value: Value } なオブジェクトを返すように変更された。*1 function * gene () { fo…
762363 - (harmony:spreadcall) implement the spread operator in calls func (a, b, ...iterableObject); な感じで、イテレート可能なオブジェクトを展開して、それぞれの引数に分けてくれるもの。func (a, b, ...[1,2,3,4]) とすると、func (a, b, 1, 2, …
MozCafe Tokyo 20130918 : ATND window.twttr = (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {}; if (d.getElementById(id)) return t; js = d.createElement(s); js.id = id; js.src = "https://platform.twit…
引っ越しして都民になりました。
DOM操作の最適化によるJavaScriptチューニング(前編) | HTML5Experts.jp はてなブックマーク - DOM操作の最適化によるJavaScriptチューニング(前編) | HTML5Experts.jp はてなブックマークで『後でツッコミする』と書いたとおり、ちょっとツッコミたいと…
Firefox 26.0a1 (Nightly) @@iterator 実装なし 代わりに iterator メソッドを定義するとOK(仕様外) __iterator__ というものもあるが、for-of とは無関係(独自実装) GeneratorObject の next メソッドは値を返すのみで{ done: ..., value: ... }な値を…
904701 - Implement prototype madness for ES6 generators Firefox 26 (Nightly) で function * () { yield ... } な ECMAScript 6th にある Generator の構文が導入された。ということで、やる気を出して、チョコチョコと調査。まず、用語の定義 Generator…
それはテメェの頭だ。 それを忘れちゃいけねえ。
578700 – (harmony:bindata) [meta] Harmony binary data objects harmony:binary_data [ES Wiki] numerictypes.js arraytype.js structtype.js 894026 – Implement BinaryIntegerLiteral and OctalIntegerLiteral binary-literals.js octal-literal.js Bina…
866847 - Implement Map#forEach and Set#forEach テストコード mozilla-central mozilla/js/src/jit-test/tests/collections/Map-forEach.js mozilla-central mozilla/js/src/jit-test/tests/collections/Set-forEach.js これで Map, Set において、ECMAScr…
記事とは関係ない質問なのですが __proto__にnullを設定した場合のみ 以降のinstanceof演算子の挙動が変わるのは仕様なのでしょうか FirefoxとChromeで確認しました o = {} o.__proto__ = Object.prototype o instanceof Object //true o.__proto__ = {} o._…
先日、「Firefox 23では「JavaScript無効化オプション」が無効化されるかも」? - hogehogeで、JavaScriptを無効にできなくなるわけではなく、オプションダイアログのチェックボックスが消えるだけだよ、という話を書いた。 チェックボックスが消える理由と…
884279 – renaming future to promise http://dom.spec.whatwg.org/#promises DOM Future ではなく、すでに、Promise に名前が変わっているけど、実装されたのは Future 。 Firefox 24(Nightly) で DOM Future が実装された - hogehoge ということで、仕様を…
Firefox 23では「JavaScript無効化オプション」が無効化されるかも | スラッシュドット・ジャパン IT 誤読されそうなので、本気で心配しているのだが、変更の Bugzilla では以下の様なタイトルである。 873709 – Firefox v23 - "Disable JavaScript " Check …
参考: 最強オブジェクト指向言語 JavaScript 再入門! >JavaScript でクラスは作れますか? 無理ポ。 では、クラスっぽいものは作れますか? だから、無理ポ。
Is the most implemented ECMAScript.next specs SpiderMonkey as known as Firefox's JavaScript engine ?Yes, indeed many of implementaions are available. I was watching and blogging the improvement. But some of things are launched for a long t…
[].indexOf に似ているけど、より汎用的なメソッドforEach, map, some, every 等と同様にコールバックを引数にとって、true を返したものの、値またはindex値を返すメソッドである。実装見たほうが分かりやすいかも。(ちょっと特殊だけどJavaScriptで書かれ…
WebPlatform 系 time 要素の実装 (Bug 629801) data 要素の実装 (Bug 839371) input[range] 要素の実装 (Bug 841948) [WebComponents] document.register の実装 (Bug 783129 about:config から dom.webcomponents.enabled を true にする必要あり FormData …
ある意味、ソーシャルボタンのJavaScriptでfunctionの前に「!」がついている理由の続き。今回は ECMAScript 6th から入る ArrowFunction で即時関数を考える巻。前回は普通の関数式での即時関数を解説してみた。 functionには2種類ある いきなり function …
結論から言うと、単なる格好付けです。以下説明。主要なJavaScript (ECMAScript 5th)では、functionは2種類あります。 文(Statement) *1 式(Expression) です。所謂、「即時関数」と呼ばれるものはfunctionは式(Expression)である必要があります。何故なら、…
function setButtonHandler () { var buttons = document.querySelectorAll(".hogeButton"); for (var i = 0, len = buttons.length; i < len; ++i) { (function(n) { buttons[i].addEventListener("click", function() { alert(n); }); }(i)); } } って感じ…
856410 - Implement promises DOM Future ではなく、すでに、Promise に名前が変わっているけど、実装されたのは Future 。 This feature used to be called futures. 4 Promise - DOM Standard テストコード: mozilla-central mozilla/dom/future/tests/tes…
要素の表示/非表示をトグルするベストプラクティス - hogehoge コメント欄にて id:Syoichi さんに hidden 属性の存在を教えてもらった。 IEではまだ実装されておらず、マークアップ上の意味を考慮する必要もありますが、将来的にはhidden属性も選択肢の一つ…
[JavaScript] tr要素 の display プロパティを用いた表示切替えについて | Blog | Development Reference を読んで、display = "block" はアカンやろ、と思ったので書いておく。 <div id="foo"> <p>FOO</p> </div> div#foo を JavaScript から表示/非表示をするには。 ダメパターン func…
こんな感じの、NOTE部分は ::before 等のCSSで書き、回り込みなしのブロックを作るやり方を模索してた。 ネガティブマージン まぁ楽ではある aside.note { padding-left: 6em; } aside.note::before { content: "NOTE"; margin-left: -5em; float: left; } <aside class="note"> <p></p></aside>…
備忘録 <button accesskey="F">hoge</button> にどうやってキーボードをアクセスするか。about:config から設定可能であり、デフォルト値が OS によって異なる。キーとなるのは ui.key.generalAccessKey ui.key.contentAccess ui.key.chromeAccess ui.key.generalAcessKey OSに関係なく、デ…
869996 – Set.prototype.{keys, values, entries} 875433 – iterator methods of [Array, Map, Set].prototype should be same function object as entries/values Array.prototype values() Map.prototype keys() values() entries() Set.prototype keys() …