GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BridgeJS: Register parameter names in scope instead of reserveNames · devxsby/JavaScriptKit@834b59a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Plugins/BridgeJS/Sources/BridgeJSLink
    • BridgeJSLink.swift
    • JSGlueGen.swift
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift‎

Copy file name to clipboardExpand all lines: Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,8 @@ public struct BridgeJSLink {
12191219
loweringFragment.parameters.count == 1,
12201220
"Lowering fragment should have exactly one parameter to lower"
12211221
)
1222-
let loweredValues = try loweringFragment.printCode([param.name], context)
1222+
let paramName = scope.variable(param.name)
1223+
let loweredValues = try loweringFragment.printCode([paramName], context)
12231224
parameterForwardings.append(contentsOf: loweredValues)
12241225
}
12251226

Collapse file

‎Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift‎

Copy file name to clipboardExpand all lines: Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ final class JSGlueVariableScope {
9090
JSGlueVariableScope(intrinsicRegistry: intrinsicRegistry)
9191
}
9292

93-
fileprivate func reserveNames(_ names: [String]) {
94-
for name in names {
95-
variables.insert(name)
96-
}
97-
}
9893
}
9994

10095
extension JSGlueVariableScope {
@@ -738,7 +733,6 @@ struct IntrinsicJSFragment: Sendable {
738733
printCode: { arguments, context in
739734
let (scope, printer) = (context.scope, context.printer)
740735
let value = arguments[0]
741-
scope.reserveNames(arguments)
742736
let isSomeVar = scope.variable("isSome")
743737
printer.write("const \(isSomeVar) = \(kind.presenceCheck(value: value));")
744738

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.