> Markdown version of [/videos/100116-extreme-rules-lawyering-with-the-ecmascript-specifications](https://www.wearedevelopers.com/videos/100116-extreme-rules-lawyering-with-the-ecmascript-specifications). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Extreme Rules Lawyering with the ECMAScript Specifications What happens when you return a Promise directly from a class constructor? Dive into the ECMAScript specifications to exploit semantic loopholes and hijack fundamental JavaScript behaviors. - **Speakers:** [Peter Kröner](https://www.wearedevelopers.com/@peter-kroner) - **Event:** World Congress 2026 Europe - **Published:** July 9, 2026 - **Duration:** 32:03 - **URL:** https://www.wearedevelopers.com/videos/100116-extreme-rules-lawyering-with-the-ecmascript-specifications ## Summary Developers often accept high-level JavaScript abstractions as ground truth, but a deep dive into the ECMAScript specifications reveals an underlying architecture where many fundamental language constructs behave unexpectedly. By exploiting strict browser backward compatibility rules, engineers can construct technically valid but highly unconventional code. For instance, new JavaScript additions like `async` and `of` are not absolute reserves; they operate exclusively as context-dependent keywords. Outside specific syntactic boundaries, they revert to regular variables, allowing developers to weaponize these semantic loopholes and write valid but baffling syntax.<br><br>Similarly, ES6 classes are fundamentally just functions that implicitly return `this`, meaning their standard behavior can be completely hijacked. Because JavaScript lacks strict internal rules regarding constructor return types, a developer can explicitly return a Promise from a class constructor by unwrapping an async call with a `.then()` chain. This reveals a uniquely foolproof pattern for asynchronous class initialization: invoking the `new` keyword yields a Promise of the instance rather than the instance itself, making it impossible to accidentally interact with uninitialized internal states.<br><br>Going even deeper into the specification edge cases proves that private class properties do not actually exist as standard object properties. Instead, they are defined in a theoretical internal slot (`[[PrivateElements]]`) that operates far more like a scoped `WeakMap`. This severely impacts metaprogramming, specifically when building exotic objects through the Proxy API. Because private fields bypass standard object internal methods like `[[Get]]` or `[[Delete]]`, Proxy traps cannot cleanly intercept them, triggering automatic exceptions if a Proxy attempts to access a private field on its target. Understanding these absolute fringes of JavaScript empowers developers to look past framework magic and accurately navigate engine constraints. **Keywords:** ecmascript specifications, javascript semantic loopholes, context-dependent keywords, es6 class mechanics, asynchronous class initialization, constructor return values, javascript internal slots, private properties architecture, proxy api traps, exotic objects metaprogramming, javascript backwards compatibility, object internal methods, weakmap memory patterns ## Chapters 1. **Overview of extreme rules lawyering in JavaScript standards** (00:00) — An introduction to reading web technology specifications and uncovering obscure JavaScript behavior. 1. **Contextual keywords and strict backward compatibility requirements** (03:29) — How browsers handle conditionally valid tokens to avoid breaking legacy code. 1. **Why JavaScript classes are actually just disguised functions** (07:52) — The technical reality that classes behave as function factories with an implicit return. 1. **Enforcing asynchronous initialization checks using class constructors** (10:50) — Using constructor return loopholes to yield promises and enforce safe object initialization. 1. **The technical illusion behind JavaScript private properties** (16:02) — Why private fields function differently from ordinary properties by relying on isolated internal slots. 1. **How standard operations map to object internal methods** (19:36) — Exploring how language syntax triggers underlying internal object methods like delete operations. 1. **Creating and manipulating exotic objects with Proxies** (22:56) — Intercepting core operations to attach custom logic and build specialized exotic objects. 1. **Observability limitations and proxy clashes with private properties** (25:25) — How private fields entirely bypass internal operations and break standard proxy interceptions. 1. **Final conclusions and Q&A on JavaScript specifications** (29:06) — A summary of specification quirks and answers to questions about promise syntax. ## Related Moments - [Evaluating the true impact of bad JavaScript features](https://www.wearedevelopers.com/videos/1451-best-of-the-worst-the-most-awful-anti-features-in-javascript-ranked) (from "Best of the Worst – the most awful anti-features in JavaScript, ranked!") - [Addressing the complaints about JavaScript as a programming language](https://www.wearedevelopers.com/videos/118-how-to-stop-choosing-javascript-frameworks-and-start-living) (from "How to Stop Choosing JavaScript Frameworks and Start Living") - [Exploring browser limits with JavaScript golfing and weird hacks](https://www.wearedevelopers.com/videos/2135-wearedevelopers-live-streaming-html) (from "WeAreDevelopers LIVE - Streaming HTML") - [Understanding core browser technologies and framework syntax sugar](https://www.wearedevelopers.com/videos/118-how-to-stop-choosing-javascript-frameworks-and-start-living) (from "How to Stop Choosing JavaScript Frameworks and Start Living") - [Handling edge cases surrounding syntax scope and formatting fallbacks](https://www.wearedevelopers.com/videos/460-future-proof-css) (from "Future-Proof CSS") - [Fundamentals of JavaScript minification and internal variable mangling](https://www.wearedevelopers.com/videos/1439-a-practical-guide-to-reducing-bundle-size) (from "A Practical Guide to Reducing Bundle Size") ## Related Articles - [Dev Digest 136 - No JS(on) of mine](https://www.wearedevelopers.com/magazine/482-dev-digest-136-no-js-on-of-mine) - [Dev Digest 124 - None like it hot](https://www.wearedevelopers.com/magazine/460-dev-digest-124-none-like-it-hot) - [Dev Digest 138 - Are you secure about this?](https://www.wearedevelopers.com/magazine/486-dev-digest-138-are-you-secure-about-this) - [Dev Digest 128 - Do not Google Monopoly](https://www.wearedevelopers.com/magazine/465-dev-digest-128-do-not-google-monopoly) ## Related Jobs - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Software Engineer](https://www.wearedevelopers.com/jobs/ext/1304673-software-engineer) at **Bitpanda** - [Software Engineer](https://www.wearedevelopers.com/jobs/ext/1377585-software-engineer) at **Bitpanda** - [Software Engineer, React & Angular (Broker Web Platform](https://www.wearedevelopers.com/jobs/ext/1558399-software-engineer-react-angular-broker-web-platform) at **Bitpanda** - [Junior Frontend Engineer](https://www.wearedevelopers.com/jobs/ext/1532351-junior-frontend-engineer) at **Almedia** - [Senior Software Engineer, Fraud](https://www.wearedevelopers.com/jobs/ext/1280398-senior-software-engineer-fraud) at **Twilio**