Skip to content

Commit 6b9e9a2

Browse files
Merge branch 'main' into feat-console-table
2 parents 1319d06 + 3016f49 commit 6b9e9a2

File tree

23 files changed

+499
-57
lines changed

23 files changed

+499
-57
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: "\U0001F41B Bug report"
33
about: Create a report to help us improve
44
title: ""
5-
labels: bug
5+
type: "Bug"
66
assignees: ""
77
---
88

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
name: Custom
3-
about: Open an issue in the repo that is neither a bug or a feature, such a new idea
3+
about: Open an issue in the repo that is neither a bug or a feature.
44
title: ""
55
labels: ""
6+
type: ""
67
assignees: ""
78
---
89

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
name: "\U0001F680 Feature request"
33
about: Suggest a new ECMAScript feature to be implemented, or a new capability of the engine.
44
title: ""
5-
labels: enhancement
5+
type: "Feature"
6+
labels: ""
67
assignees: ""
78
---
89

.github/labeler.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
C-Actions:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- '.github/**'
5+
6+
C-AST:
7+
- changed-files:
8+
- any-glob-to-any-file: 'core/ast/**'
9+
10+
C-Benchmark:
11+
- changed-files:
12+
- any-glob-to-any-file:
13+
- 'benches/**'
14+
- 'core/engine/benches/**'
15+
16+
C-Builtins:
17+
- changed-files:
18+
- any-glob-to-any-file:
19+
- 'core/engine/src/builtins/**'
20+
- 'core/engine/src/object/builtins/**'
21+
- all-globs-to-all-files:
22+
- '!core/engine/src/object/builtins/intl/**'
23+
24+
C-CLI:
25+
- changed-files:
26+
- any-glob-to-any-file:
27+
- 'cli/**'
28+
29+
C-Dependencies:
30+
- changed-files:
31+
- any-glob-to-any-file:
32+
- '**/Cargo.lock'
33+
- '**/Cargo.toml'
34+
35+
C-Documentation:
36+
- changed-files:
37+
- any-glob-to-any-file:
38+
- '**/*.md'
39+
40+
C-FFI:
41+
- changed-files:
42+
- any-glob-to-any-file:
43+
- 'ffi/**'
44+
45+
C-GC:
46+
- changed-files:
47+
- any-glob-to-any-file:
48+
- 'core/gc/**'
49+
50+
C-Intl:
51+
- changed-files:
52+
- any-glob-to-any-file:
53+
- 'core/engine/src/builtins/intl/**'
54+
55+
C-Javascript:
56+
- changed-files:
57+
- any-glob-to-any-file:
58+
- '**/*.js'
59+
60+
C-Parser:
61+
- changed-files:
62+
- any-glob-to-any-file:
63+
- 'core/parser/**'
64+
65+
C-Runtime:
66+
- changed-files:
67+
- any-glob-to-any-file:
68+
- 'core/runtime/**'
69+
70+
C-Tests:
71+
- changed-files:
72+
- any-glob-to-any-file:
73+
- '**/tests/**'
74+
- '**/test*'
75+
76+
C-VM:
77+
- changed-files:
78+
- any-glob-to-any-file:
79+
- 'core/engine/src/bytecompiler/**'
80+
- 'core/engine/src/vm/**'
81+
82+
C-WebAssembly:
83+
- changed-files:
84+
- any-glob-to-any-file:
85+
- 'ffi/wasm/**'

.github/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ changelog:
77
categories:
88
- title: Feature Enhancements
99
labels:
10-
- enhancement
10+
- A-Enhancement
1111
- title: Bug Fixes
1212
labels:
13-
- bug
13+
- A-Bug
14+
- title: Performance Improvements
15+
labels:
16+
- A-Performance
17+
- A-Memory
1418
- title: Internal Improvements
1519
labels:
16-
- Internal
17-
- memory
20+
- A-Internal
21+
- A-Technical Debt
1822
- title: Other Changes
1923
labels:
2024
- "*"

.github/workflows/labeler.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
labeler:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v6

.github/workflows/pr_management.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
issue_number: context.issue.number,
2121
owner: context.repo.owner,
2222
repo: context.repo.repo,
23-
labels: ['waiting-for-review']
23+
labels: ['Waiting On Review']
2424
})
2525
2626
- name: Auto Remove Label
@@ -34,10 +34,10 @@ jobs:
3434
issue_number: context.issue.number,
3535
owner: context.repo.owner,
3636
repo: context.repo.repo,
37-
name: 'waiting-for-review'
37+
name: 'Waiting On Review'
3838
});
3939
} catch (error) {
40-
console.log('Label "waiting-for-review" not found or could not be removed.');
40+
console.log('Label "Waiting On Review" not found or could not be removed.');
4141
}
4242
4343
- name: Auto Assign Milestone

core/ast/src/expression/call.rs

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,32 @@ impl VisitWith for SuperCall {
182182
}
183183
}
184184

185+
/// The phase of a dynamic import call.
186+
///
187+
/// Determines how the imported module is handled:
188+
/// - `Evaluation` (default): `import(specifier)` — loads, links, and evaluates the module.
189+
/// - `Defer`: `import.defer(specifier)` — deferred evaluation of the module.
190+
/// - `Source`: `import.source(specifier)` — source phase import.
191+
///
192+
/// More information:
193+
/// - [import-defer proposal][defer]
194+
/// - [source-phase-imports proposal][source]
195+
///
196+
/// [defer]: https://github.com/tc39/proposal-defer-import-eval
197+
/// [source]: https://github.com/tc39/proposal-source-phase-imports
198+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
199+
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
200+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
201+
pub enum ImportPhase {
202+
/// `import(specifier)` — standard dynamic import.
203+
#[default]
204+
Evaluation,
205+
/// `import.defer(specifier)` — deferred import evaluation.
206+
Defer,
207+
/// `import.source(specifier)` — source phase import.
208+
Source,
209+
}
210+
185211
/// The `import()` syntax, commonly called dynamic import, is a function-like expression that allows
186212
/// loading an ECMAScript module asynchronously and dynamically into a potentially non-module
187213
/// environment.
@@ -198,20 +224,22 @@ impl VisitWith for SuperCall {
198224
pub struct ImportCall {
199225
specifier: Box<Expression>,
200226
options: Option<Box<Expression>>,
227+
phase: ImportPhase,
201228
span: Span,
202229
}
203230

204231
impl ImportCall {
205232
/// Creates a new `ImportCall` AST node.
206233
#[inline]
207234
#[must_use]
208-
pub fn new<S>(specifier: S, options: Option<Expression>, span: Span) -> Self
235+
pub fn new<S>(specifier: S, options: Option<Expression>, phase: ImportPhase, span: Span) -> Self
209236
where
210237
S: Into<Expression>,
211238
{
212239
Self {
213240
specifier: Box::new(specifier.into()),
214241
options: options.map(Box::new),
242+
phase,
215243
span,
216244
}
217245
}
@@ -235,6 +263,13 @@ impl ImportCall {
235263
self.options.as_deref()
236264
}
237265

266+
/// Returns the phase of this import call.
267+
#[inline]
268+
#[must_use]
269+
pub const fn phase(&self) -> ImportPhase {
270+
self.phase
271+
}
272+
238273
/// Gets the module specifier of the import call.
239274
///
240275
/// This is an alias for [`Self::specifier`] for backwards compatibility.
@@ -256,14 +291,24 @@ impl Spanned for ImportCall {
256291
impl ToInternedString for ImportCall {
257292
#[inline]
258293
fn to_interned_string(&self, interner: &Interner) -> String {
294+
let phase_str = match self.phase {
295+
ImportPhase::Evaluation => "",
296+
ImportPhase::Defer => ".defer",
297+
ImportPhase::Source => ".source",
298+
};
259299
if let Some(options) = &self.options {
260300
format!(
261-
"import({}, {})",
301+
"import{}({}, {})",
302+
phase_str,
262303
self.specifier.to_interned_string(interner),
263304
options.to_interned_string(interner)
264305
)
265306
} else {
266-
format!("import({})", self.specifier.to_interned_string(interner))
307+
format!(
308+
"import{}({})",
309+
phase_str,
310+
self.specifier.to_interned_string(interner)
311+
)
267312
}
268313
}
269314
}

core/ast/src/expression/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use crate::{
4545
visitor::{VisitWith, Visitor, VisitorMut},
4646
};
4747
pub use r#await::Await;
48-
pub use call::{Call, ImportCall, SuperCall};
48+
pub use call::{Call, ImportCall, ImportPhase, SuperCall};
4949
pub use identifier::{Identifier, RESERVED_IDENTIFIERS_STRICT};
5050
pub use import_meta::ImportMeta;
5151
pub use new::New;

core/engine/src/builtins/date/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Date {
5050

5151
/// Creates a new `Date` from the current UTC time of the host.
5252
pub(crate) fn utc_now(context: &mut Context) -> Self {
53-
Self(context.clock().now().millis_since_epoch() as f64)
53+
Self(context.clock().system_time_millis() as f64)
5454
}
5555
}
5656

@@ -210,7 +210,7 @@ impl BuiltInConstructor for Date {
210210
// 1. If NewTarget is undefined, then
211211
if new_target.is_undefined() {
212212
// a. Let now be the time value (UTC) identifying the current time.
213-
let now = context.clock().now().millis_since_epoch();
213+
let now = context.clock().system_time_millis();
214214

215215
// b. Return ToDateString(now).
216216
return Ok(JsValue::from(to_date_string_t(
@@ -328,7 +328,7 @@ impl Date {
328328
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now
329329
#[allow(clippy::unnecessary_wraps)]
330330
pub(crate) fn now(_: &JsValue, _: &[JsValue], context: &mut Context) -> JsResult<JsValue> {
331-
Ok(JsValue::new(context.clock().now().millis_since_epoch()))
331+
Ok(JsValue::new(context.clock().system_time_millis()))
332332
}
333333

334334
/// `Date.parse()`

0 commit comments

Comments
 (0)