summaryrefslogtreecommitdiff
path: root/ext/webidl/00_webidl.js
AgeCommit message (Collapse)Author
2024-11-15feat(fetch): accept async iterables for body (#26882)Luca Casonato
Reland of #24623, but with a fix for `String` objects. Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-09-19refactor(ext/webidl): align error messages (#25625)Ian Bull
Towards https://github.com/denoland/deno/issues/25269
2024-09-06fix(runtime): use more null proto objects again (#25040)Kenta Moriuchi
proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-08-28refactor(ext): throw new error instead of throw error (#25272)Ian Bull
To ensure consistency across the codebase, this commit refactors the code in the `ext` folder to use `throw new Error`` instead of `throw` for throwing errors. Fixes https://github.com/denoland/deno/issues/25270
2024-08-26Revert "feat(fetch): accept async iterables for body" (#25207)Luca Casonato
Unfortunately this caused a regression: https://github.com/denoland/deno/issues/25203. Need to do some more upstream spec work to fix this before this can be re-landed. Reverts denoland/deno#24623
2024-08-06feat(fetch): accept async iterables for body (#24623)Leo Kettmeir
Implements https://github.com/whatwg/webidl/pull/1397 Fixes #21454 Closes #24849
2024-05-23fix(runtime): use more null proto objects (#23921)Luca Casonato
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-04-23fix: Float16Array support (#23512)Kenta Moriuchi
Ref #23490, #23277 * remove `--js-float16array` flag (This flag has already added to deno_core) * add some `Float16Array` support
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-07fix(ext): enable prefer-primordials for internal TypeScript (#21813)Kenta Moriuchi
Enabled prefer-primordials lint for ext/cron and ext/kv.
2024-01-04fix: strict type check for cross realms (#21669)Kenta Moriuchi
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when using `Object.prototype.isPrototypeOf` to check built-in types. ```js import vm from "node:vm"; const err = new Error(); const crossErr = vm.runInNewContext(`new Error()`); console.assert( !(crossErr instanceof Error) ); console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) ); ``` This PR changes to check using internal slots solves them. --- current: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error {} > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) Date {} ``` this PR: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error: message at <anonymous>:1:1 > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) 2018-12-10T02:26:59.002Z ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-11-06fix(ext): use `String#toWellFormed` in ext/webidl and ext/node (#21054)Kenta Moriuchi
Fixes #18802 This PR adds `util.toUSVString` to node:util: ```js import util from "node:util"; util.toUSVString("string\ud801"); // => "string\ufffd" ```
2023-10-10fix(ext/web): writability of `ReadableStream.from` (#20836)Luca Casonato
Fixes a WPT in `URL` and `ReadableStream`. Some unrelated WPT expectation changes due to WPT update.
2023-09-07feat: support import attributes (#20342)David Sherret
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-06-09perf: optimize ByteString checks, hoist server rid getter (#19452)Bartek Iwańczuk
Further improves preact SSR and express benches by about 2k RPS. Ref https://github.com/denoland/deno/issues/19451
2023-06-05perf: optimize RegExp usage in JS (#19364)Bartek Iwańczuk
Towards https://github.com/denoland/deno/issues/19330 Shows about 1% improvement in the HTTP benchmark.
2023-05-18fix(ext/webidl): change createPromiseConverter (#16367)Marcos Casagrande
2023-05-02refactor(core): Use `ObjectHasOwn` instead of ↵Kenta Moriuchi
`ObjectPrototypeHasOwnProperty` (#18952) ES2022 `Object.hasOwn` can be used in snapshot, so I migrate to use it.
2023-05-01refactor(webidl): move prefix & context out of converters options bag (#18931)Leo Kettmeir
2023-04-20refactor(ext/webidl): remove option bags from "makeException" (#18679)Bartek Iwańczuk
Creating these options bags is more costly than passing arguments one-by-one. Especially since `prefix` and `context` are passed to all functions.
2023-04-14fix(core): Use safe primordials wrappers (#18687)Kenta Moriuchi
2023-04-12refactor(ext/webidl): remove object from 'requiredArguments' (#18674)Bartek Iwańczuk
This should produce a little less garbage and using an object here wasn't really required. --------- Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com> Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2023-04-02chore: Turn back on dlintPreferPrimordials (#17715)Kenta Moriuchi
Closes #17709
2023-03-01fix(core): introduce `SafeRegExp` to primordials (#17592)Kenta Moriuchi
2023-02-09refactor(ext/webidl): use `TypedArrayPrototypeGetSymbolToStringTag` (#17602)Kenta Moriuchi
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-29fix(ext): internal `structuredClone` for `ArrayBuffer` and `TypedArray` ↵Kenta Moriuchi
subclasses (#17431)
2023-01-16chore: update dlint to v0.37.0 for GitHub Actions (#17295)Kenta Moriuchi
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
2023-01-13fix(webidl): properly implement setlike (#17363)Leo Kettmeir
2023-01-06perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)Kenta Moriuchi
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-22fix(ext): Add checks for owning properties in for-in loops (#17139)Kenta Moriuchi
In the for-in loops, there were a few places where we forgot to check if objects owned some properties, so I added them.
2022-12-20chore: Update dlint (#17031)Kenta Moriuchi
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
2022-04-16refactor: update runtime code for primordial check x in y (#13642)Bartek Iwańczuk
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-03-19chore(core,ext): minor JS optimisations (#13950)Aapo Alasuutari
2022-02-01refactor: primordials for instanceof (#13527)Bartek Iwańczuk
2022-01-27Revert "refactor: update runtime code for primordial checks for "instanceof" ↵Bartek Iwańczuk
(#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
2022-01-27refactor: update runtime code for primordial checks for "instanceof" (#13497)Bartek Iwańczuk
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-10-28fix(webidl): Don't throw when converting a detached buffer source (#12585)Andreu Botella
The Web IDL conversion to `BufferSource` and similar types shouldn't check whether the buffer is detached. In the case of `TextDecoder`, our implementation would still throw after the Web IDL conversions because we're creating a new `Uint8Array` from the buffer source's buffer, which throws if it's detached. This change also fixes this bug.
2021-10-05perf(webidl): fix typo from #12286 (#12336)Aaron O'Mullan
In a tweak commit of #12286 I accidentally eliminated the else branch ... running the slow & the fast path providing a worst of both worlds path
2021-10-04perf(webidl): optimize createRecordConverter() (#12286)Aaron O'Mullan
Cuts self-time by ~6x, 172ns/iter => 22ns/iter benched on 1M Response builds / HeadersInit calls
2021-09-30perf(webidl): optimize createDictionaryConverter() (#12279)Aaron O'Mullan
On a benchmark constructing Responses with headers this shaves off 25%
2021-09-29perf(webidl/DOMString): don't wrap string primitives (#12266)Aaron O'Mullan
2021-09-26perf(webidl/ByteString): 3x faster ASCII check (#12230)Aaron O'Mullan
2021-09-25fix(ext/webidl): correctly apply [SymbolToStringTag] to interfaces (#11851)李瑞丰
Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-08-24refactor(webgpu): use op interface idiomatically (#11835)Luca Casonato