zhangdaren
zhangdaren
Add rename function into scope, like Babel function path.scope.rename(oldName, newName)
## Environment - Browser: - Version of smooth-scrollbar: ## Issue Summary 如题,参考文档: https://www.cnblogs.com/milo-wjh/p/6364138.html ## Current Behavior ## Expected Behavior ## Steps to Reproduce ## Online demo
厉害厉害,大佬会跟进ios版和短视频sdk吗?谢谢~
如题,现在想在小程序里面使用,但目前sdk导入小程序报错。
- version: 1.0.55 - playground demo: [link](https://play.gogocode.io/#code/N4IglgdgDgrgLgYQPYBMCmIBcIQBoQDuSATgNbLpYgD01gaJqAXCYHkagBUqAyEYFjygpUaCYqQDoQAZjAgBjOGCQQABHGIBDCAGdBJALYAKQWAA2aAJJCkuafKhgTSKBKlKAlNOAC+cUbbjSAJNIC8p8wB0AOZIIW7oznAAbvLE0kpIMMSiaL7S2nqGqgEJSSnOEC7EaHBJMgCMAgC+Anjg0PAAMopBVHAAnlBoSqLEYNZ1ABbySgAKxXASaMRYgvI6Smj4SjAARgBqYGgEACqdGNhyaBhVQA) - detail desc: 如题。
- version: 1.0.40 - playground demo: [link](https://play.gogocode.io/?v=1.0.40#code/N4IglgdgDgrgLgYQPYBMCmIBcIA8KwBuABAMYA2AhgM5UC8AOiBYwHwCMOA9PgS-RHkKlKNBk1YAmLjz4QQAGhAB3JACcA1snRYQAMxgQScMEghE4qihCq61AWwAUusGTQBJCLflEKUMN6QoY1MqAEoiYH4iUhC4IgASIlofPwA6AHMkTJJUNCiY6ziqJBhVEjQkomdXD1tU4tLy-JzCnyo45PiHBrK0b2AiKApVKjQAeSCTa0wIokoIdJgKdLQZgHIACzg7MjWiAF8D0PzqOFTVNChKcoc1wWJyajpGZhAWeIB9eOlCFjXvO4yT7fbi-NbHMxETicIgXOClMwATxKqnMlmstlUdjQKBi6CIGzQF3ycIRbTOKwgRIocDQDgh+34CnA0HgABkrOkdFsdsyNtQAApw4xErAWGB9EBUGAAIwAamA0EoACqIqAYbAWNAYfZAA) - detail desc: - ``` html ``` 上面的play地址可以无视,先把语言改成html,然后再输入上面这个注释放在play里面,然后就崩了。。。 在实际解析中。会报错: UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined at serializeCommentNode (E:\zpWork\Project_self\miniprogram-to-uniapp\node_modules\gogocode\src\html-core\serialize-node.js:22:39) at serializeNode (E:\zpWork\Project_self\miniprogram-to-uniapp\node_modules\gogocode\src\html-core\serialize-node.js:133:16)...
解析代码: var a = function(options){ if(options.invoice){ const {...params} = options; } } 操作scope时,报错啦~ 报错信息: undefined does not match type Pattern - version: 1.0.37 - playground demo: [link](https://play.gogocode.io/?v=1.0.37#code/N4IglgdgDgrgLgYQPYBMCmIBcIBuBDAJwAI8iBeIgMxggGM4wkIAKJKBpgZwEpgAdCESFEwlVu0YROAOkg4kYWml4DhaorS5wiwaXqiE8AW04BfckTYcpAblXDTA0yAA0IAO5ICAa2TosINR01kRwBHhSlF5GzJRgADZoAJIQUS4kUGDpVpI8OvaaUtoAJBZ4mdIA5kjVmugFWkScSDAEShZxiSlR0s2tSvYA9INEBGhwrYIAni3EYRGcUQRGaCgaqGhEABZoY-ZjEwSCxcx9bcr2QtJxECjMwKFTUGiYRADkALJoRgBGuwCiAA8oGNOJxJG8iKZuJciNI0HhaFtYjR6JIiMwwHBvtx8oJ1PhiD9IChIJVOBYsd8ANoABgAutIIBsAAp4OBbXqaZ5VcYAIRJZM4zBh+KE0NhvIgu3ZaBFTgErnA0HgABkIpUAnAnmhOLQCGB2EqtnhOCyDgxdlgwjA0G5NEYDGMAPLwWBwa0EW2mIA) - detail desc:
代码:`test({})` $(source).replace("test({$$$})", "var a = {$$$}").root().generate({ isPretty: true }) 即可复现,不加 isPretty 是正常的。 复现地址: https://play.gogocode.io/#code/N4IglgdgDgrgLgYQPYBMCmIBcI5oM5wAUwAvgJQgA0IA7kgE4DWy6WIAZjBAMZxhIQABHHoBDCHnYMAtoXZgANmgCSEKZUGioYDUih8BeMoOAAdIYO6G4ggCSCAvJu0A6AOZIPV9OcGXrgnhIMPTcaI6C8kqqUi5BIWG+ggD0yYKAFOqAm-GAM4mAK-GAe2qABvKA+K6ACEaAIW6Ax3KAgB5J9GhwIUK2hPGhaGQu9VAKomGEpjj4RMC2Y+SDGoMAbqL0mhGj44Od9EhIRJ1uaBBoYrjEgmB4AAr1cHAAnpjC9DDhExAk5lTg0PAAMuJubFdQ+Nx6GB9K8ABaiU7nPh7LDsUQKPBoahWaRQOZoADy8FgcCwInuJCAA
比如: `var a = this, b=666` 使用选择器: `var $_$1 = this` 得到的结果是: `var a= this` 和 ` b =666 ` 两条数据,实际,只需要 `var a = this` 这条数据。 地址: https://play.gogocode.io/#code/N4IglgdgDgrgLgYQPYBMCmIBcIBuBDAJwAI44iBeEgCzAGcAaIvCogRgG4AdCEekAdyQEA1snRYQAMxgQAxnDBIIJAngi1JQgLYAKSWAA2aAJIRNjPFDCMkUBUtoBKIsG5Eish2QAkLS2AA6AHMkEM90Nw8vIlokGAJZNBZ9I1NNANj4xMiAehyiQAp1QE34wBnEwBX4wD21QAN5QHxXQAQjQBC3QGO5QEAPSII0OHjlbx1MhLRHSPcA-QgUHQByfGJvAH1vOBpaADk8LSTKJbpJoeV3IgC0PFkqPRl5RWUdMDg0LWdXfYOo9SQjAINQm7uH4YP-gBfPYvYJoCBoVR3HR7QHcXjgaDwAAyaiCEjgAE8oGhaLICGA7AiqHhaAAFDqkMCQrBwAgwNB8TxaKCENAAeXgsDgtPpaEBQA
比如: code: ·`fun("abcd") ? test("abcd", 1) : fun("abcd") ? test("abcd", 2): test("abcd", 3)` $(source) .replace('$_$1', "$_$1") .replace('test', "xxxxxxxxx") .generate() 替换后应该是: `fun("abcd") ? xxxxxxxxx("abcd", 1) : fun("abcd") ? xxxxxxxxx("abcd", 2): xxxxxxxxx("abcd",...