aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--integration/bunjs-only-snippets/toml-fixture.toml9
-rw-r--r--integration/bunjs-only-snippets/toml.test.js7
-rw-r--r--src/toml/toml_parser.zig3
3 files changed, 17 insertions, 2 deletions
diff --git a/integration/bunjs-only-snippets/toml-fixture.toml b/integration/bunjs-only-snippets/toml-fixture.toml
index 259891be7..090563ef7 100644
--- a/integration/bunjs-only-snippets/toml-fixture.toml
+++ b/integration/bunjs-only-snippets/toml-fixture.toml
@@ -7,6 +7,15 @@ inline.array = [1234, 4, 5, 6]
[macros]
react-relay = { "graphql" = "node_modules/bun-macro-relay/bun-macro-relay.tsx" }
+[install.scopes]
+"@mybigcompany2" = { "token" = "123456", "url" = "https://registry.mybigcompany.com" }
+"@mybigcompany3" = { "token" = "123456", "url" = "https://registry.mybigcompany.com", "three" = 4 }
+
+
+[install.scopes."@mybigcompany"]
+token = "123456"
+url = "https://registry.mybigcompany.com"
+
[bundle.packages]
"@emotion/react" = true
diff --git a/integration/bunjs-only-snippets/toml.test.js b/integration/bunjs-only-snippets/toml.test.js
index 5e2d184d8..ecf0f5f8a 100644
--- a/integration/bunjs-only-snippets/toml.test.js
+++ b/integration/bunjs-only-snippets/toml.test.js
@@ -14,4 +14,11 @@ it("syntax", async () => {
expect(toml.inline.array[0]).toBe(1234);
expect(toml.inline.array[1]).toBe(4);
expect(toml.dev["foo.bar"]).toBe("baz");
+ expect(toml.install.scopes["@mybigcompany"].url).toBe(
+ "https://registry.mybigcompany.com"
+ );
+ expect(toml.install.scopes["@mybigcompany2"].url).toBe(
+ "https://registry.mybigcompany.com"
+ );
+ expect(toml.install.scopes["@mybigcompany3"].three).toBe(4);
});
diff --git a/src/toml/toml_parser.zig b/src/toml/toml_parser.zig
index f4014404e..6673d5c41 100644
--- a/src/toml/toml_parser.zig
+++ b/src/toml/toml_parser.zig
@@ -325,14 +325,13 @@ pub const TOML = struct {
.t_open_brace => {
try p.lexer.next();
var is_single_line = !p.lexer.has_newline_before;
- var properties = std.ArrayList(G.Property).init(p.allocator);
var stack = std.heap.stackFallback(@sizeOf(Rope) * 6, p.allocator);
var key_allocator = stack.get();
var expr = p.e(E.Object{}, loc);
var obj = expr.data.e_object;
while (p.lexer.token != .t_close_brace) {
- if (properties.items.len > 0) {
+ if (obj.properties.len > 0) {
if (p.lexer.has_newline_before) {
is_single_line = false;
}