shithub: mycel

Download patch

ref: 7122c8829560b74e25f92079c6ea0e8576b31738
parent: f9ff39ba72623d7392b9388567cd9154dc97ce47
author: Philip Silva <philip.silva@protonmail.com>
date: Thu Mar 4 16:48:09 EST 2021

update goja ->real support for block-scope variables

--- a/domino/domino.go
+++ b/domino/domino.go
@@ -149,8 +149,6 @@
 }
 
 func (d *Domino) Exec(script string, initial bool) (res string, err error) {
-	script = strings.Replace(script, "const ", "var ", -1)
-	script = strings.Replace(script, "let ", "var ", -1)
 	script = strings.Replace(script, "<!--", "", -1)
 	SCRIPT := domIntf + script
 	if !initial {
--- a/go.mod
+++ b/go.mod
@@ -15,7 +15,7 @@
 	github.com/andybalholm/cascadia v1.1.0
 	github.com/chris-ramon/douceur v0.2.1-0.20160603235419-f3463056cd52
 	github.com/dlclark/regexp2 v1.4.0 // indirect
-	github.com/dop251/goja v0.0.0-20210126164150-f5884268f0c0
+	github.com/dop251/goja v0.0.0-20210227132020-101e13ab2c34
 	github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7
 	github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
 	github.com/gorilla/css v1.0.0 // indirect
--- a/go.sum
+++ b/go.sum
@@ -6,8 +6,8 @@
 github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
 github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
 github.com/dop251/goja v0.0.0-20191203121440-007eef3bc40f/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA=
-github.com/dop251/goja v0.0.0-20210126164150-f5884268f0c0 h1:6zmaq2NhOm//MNgxDPXoLiWS1c/WTPxqqeUAQFrZRbQ=
-github.com/dop251/goja v0.0.0-20210126164150-f5884268f0c0/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA=
+github.com/dop251/goja v0.0.0-20210227132020-101e13ab2c34 h1:6EdB02rE/HuQr2fZT8D0nJJmXhFd6pCq41262yJlp1I=
+github.com/dop251/goja v0.0.0-20210227132020-101e13ab2c34/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA=
 github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7 h1:tYwu/z8Y0NkkzGEh3z21mSWggMg4LwLRFucLS7TjARg=
 github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
 github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=