Commit graph

20 commits

Author SHA1 Message Date
Kenta Moriuchi 515a34b4de
refactor: use core.ensureFastOps() (#21888) 2024-01-10 15:37:25 -07:00
Kenta Moriuchi b2cd254c35
fix: strict type check for cross realms (#21669)
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-04 09:42:38 +05:30
David Sherret 7e72f3af61
chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
Bartek Iwańczuk c1fc7b2cd5
refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)
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-12-07 14:21:01 +01:00
Kenta Moriuchi c806fbdabe
fix(ext,runtime): add missing custom inspections (#21219) 2023-11-19 09:13:38 +01:00
Luca Casonato 2665ca103e
fix(ext/web): writability of ReadableStream.from (#20836)
Fixes a WPT in `URL` and `ReadableStream`.

Some unrelated WPT expectation changes due to WPT update.
2023-10-10 05:01:01 +02:00
Leo Kettmeir b31cf9fde6
refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
Leo Kettmeir 59825a95b4
refactor: remove ext/console/01_colors.js (#18927) 2023-04-30 09:11:37 +00:00
Bartek Iwańczuk a3c5193a2e
refactor(ext/webidl): remove object from 'requiredArguments' (#18674)
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-12 19:58:57 +00:00
Bartek Iwańczuk 72fe9bb470
refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme for snapshotted modules (#18041)
This commit renames "deno_core::InternalModuleLoader" to
"ExtModuleLoader" and changes the specifiers used by the 
modules loaded from this loader to "ext:".

"internal:" scheme was really ambiguous and it's more characters than
"ext:", which should result in slightly smaller snapshot size.

Closes https://github.com/denoland/deno/issues/18020
2023-03-08 12:44:54 +01:00
Leo Kettmeir 49af1ab18d
refactor: remove prefix from include_js_files & use extension name (#17683) 2023-02-07 21:09:50 +00:00
Leo Kettmeir b4aa153097
refactor: Use ES modules for internal runtime code (#17648)
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-02-07 20:22:46 +01:00
David Sherret 10e4b2e140
chore: update copyright year to 2023 (#17247)
Yearly tradition of creating extra noise in git.
2023-01-02 21:00:42 +00:00
Andreu Botella dbcbf53ab5
experiment(ext/web): Don't expose event classes during the bootstrap phase (#16213) 2022-10-24 16:14:17 +02:00
cjihrig 95312ab53a fix: make Performance global an EventTarget
This commit updates the Performance global to extend
EventTarget.
2022-06-16 12:05:33 -04:00
Geert-Jan Zwiers 0568be863b
feat(ext/web): add performance.toJSON (#14548) 2022-05-13 18:36:00 +02:00
Luca Casonato 2f7f41533b
fix(ext/web): brand check in performance.timeOrigin (#14550) 2022-05-10 02:31:35 +02:00
Geert-Jan Zwiers dd1d6a0f67
feat(web): add performance.timeOrigin (#14489)
Add support for the `performance.timeOrigin` web API.

Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
2022-05-06 19:37:18 +02:00
Bartek Iwańczuk 0bb96cde72
refactor: update runtime code for primordial check x in y (#13642)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-16 14:09:07 +02:00
Andreu Botella 760f4c9e24
chore(ext/timers): move ext/timers to ext/web (#13665) 2022-02-15 12:17:30 +01:00
Renamed from ext/timers/02_performance.js (Browse further)