# JavaScriptで括弧を使わずに関数を呼び出す新たな手法が登場

Original title: Yet another way to invoke functions without parentheses

> Hacker News story 50077225 · language: ja · submitted 2026-10-13
> Web version: https://zeli.app/ja/story/50077225
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 262 · by [aragonite](<https://news.ycombinator.com/user?id=aragonite>) · 💬 105
[original](<https://blog.ikaes.de/yet-another-way-to-invoke-functions-without-parentheses/>) · [HN discussion](<https://news.ycombinator.com/item?id=50077225>)

## Summary

JavaScriptで括弧なしに関数を呼び出す新たな手法が公開された。ErrorオブジェクトのprepareStackTraceをFunctionコンストラクタに置き換え、Array.prototype.toStringを操作して任意のコードを生成。最後にvalueOfトリックで実行する。プロトタイプ汚染を利用するなど、セキュリティ研究や難読化の文脈で興味深い。

## Key quote

> Object.prototype.message='alert\x281337\x29';Array.prototype.toString=Error.prototype.toString;Error.prepareStackTrace = Function;const x = new Error;x.valueOf=x.stack;+x;

## HN discussion (105 comments)

### [hans_castorp](<https://news.ycombinator.com/item?id=50116896>)

> これは「Creators admit Unix, C hoax」を思い出させるな（例: https://www.gnu.org/fun/jokes/unix-hoax.html）
>
> \> 以下の構文がきれいにコンパイルできた時点でやめた:
>
> for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

### [nathell](<https://news.ycombinator.com/item?id=50116963>)

> これはいいね。楽しいハックだけど、この記事は人々がまだ _コード_ そのものに興味を持っていた LLM 以前の時代を思い起こさせる。

### [amelius](<https://news.ycombinator.com/item?id=50117797>)

> 呼び出される関数を引数の後に置きたい:
>
> (((x)f)g)h
>
> そうすれば、物事が起こる順序を左から右へ正確に見ることができる。
>
> これに対して:
>
> f(g(h(x)))
>
> こちらは逆から読まなければならない。

### [MattCruikshank](<https://news.ycombinator.com/item?id=50118596>)

> ここからあそこへデータを移動する方法を、思いつく限り全部載せた超衒学的な本を書きたい。同じプログラム内でも、プログラム間でも。
>
> グローバル変数。
>
> 関数のパラメータ。
>
> ファンクタ/ラムダを渡して値を受け取る。
>
> 環境変数。
>
> レジストリ。
>
> ファイル。
>
> ping レスポンスに格納する。
>
> 書き込んでから読み出す VRAM テクスチャ。
>
> データベース。
>
> REST サーバー。
>
> 千通りくらいは思いつく自信がある。
>
> でも…なぜ？ なぜこの本を書きたいのか？ なぜ頭から離れないのか？

### [sharktheone](<https://news.ycombinator.com/item?id=50121945>)

> TC39 メンバーです。JS で括弧なしに関数を呼び出す方法はもっとたくさんあります。真っ先に思い浮かぶのは Symbol.isConcatSpreadable や Symbol.iterator で、これらは複数の場所で機能します。

### [CrendKing](<https://news.ycombinator.com/item?id=50117115>)

> ドキュメントによると Error.prepareStackTrace はオプションの API で V8 にしか実装されていないので、Firefox では動きません。

### [pards](<https://news.ycombinator.com/item?id=50116791>)

> 脱線ですが、このウェブサイトは身代金要求のメモみたいに見えますね。

### [TheSilva](<https://news.ycombinator.com/item?id=50116732>)

> Object.prototype.message='alert\x281337\x29';Array.prototype.toString=Error.prototype.toString;Error.prepareStackTrace = Function;const x = new Error;x.valueOf=x.stack;+x;
>
> うーん、なんて長ったらしいんだ！ こんなに長い年月が経っても、JavaScript はコーディングの世界で最も驚くべき、奇妙で、素晴らしく、恐ろしく、難解で、セクシーなことができるんだな。

---

## Cite

- Page: https://zeli.app/ja/story/50077225
- Date: 2026-10-13
- Source: blog.ikaes.de (https://blog.ikaes.de/yet-another-way-to-invoke-functions-without-parentheses/)
- Hacker News: https://news.ycombinator.com/item?id=50077225

## Other languages

- en: https://zeli.app/story/50077225 · markdown: https://zeli.app/story/50077225.md
- zh: https://zeli.app/zh/story/50077225 · markdown: https://zeli.app/zh/story/50077225.md
- ko: https://zeli.app/ko/story/50077225 · markdown: https://zeli.app/ko/story/50077225.md
- de: https://zeli.app/de/story/50077225 · markdown: https://zeli.app/de/story/50077225.md
- es: https://zeli.app/es/story/50077225 · markdown: https://zeli.app/es/story/50077225.md
- ru: https://zeli.app/ru/story/50077225 · markdown: https://zeli.app/ru/story/50077225.md
