3 ms·
I think they are just reusing technologies commonly used in China on TikTok website so they don't write it twice. In China many frontend developers write code f
by renonce 4y ago
I think they are just reusing technologies commonly used in China on TikTok website so they don't write it twice. In China many frontend developers write code for WeChat mini program. WeChat mini program is just a typical HTML website with extra APIs and the restriction that code has to be uploaded for review before they are deployed, and `eval` (and anything else that allows executing string as script directly) is disallowed in order to prevent sneaking code past review. Many developers developed their own JavaScript VM and interpreter to bypass that restriction, and that same code happens to be reused on all HTML based platforms even outside WeChat.
- dna_polymerase 4y agoSo they won't let you do eval but don't mind a whole VM? This doesn't sound right, unless eval touches something deeper and might pose a security risk, while the VM runs inside the normal sandbox. Can you elaborate a bit, or hint at further resources? It sounds fascinating.
- postalrat 4y agoEval touches everything in scope where it's executed. The VM will only have access to what it is given.
- sebazzz 4y agoIt sounds a bit useless as the entire "window" variable is passed - which basically gives it access it anything.
- joshspankit 4y agoYeah, this smells like a tactic that will eventually get shut down for being in bad faith
- kaba0 4y agoI’m fairly sure that it is impossible to tell from arbitrary code whether it is an interpreter or not. This is just something inherent in Turing machines, they can emulate other Turing machines.