What is a Document? And question about isolating parts of a large number of scripts. #600
-
Hi, I didn't find much documentation around what The important second question, is there a way to isolate multiple scripts in a way that one script can't modify globals for other scripts, but we could add host types which will be accessible to all? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi @the-byte-bender,
A
If you're asking whether you can expose a specific host object or type in multiple script engines, then yes, absolutely. On the other hand, if you're asking whether ClearScript has a feature whereby a set of host resources is added automatically to every new script engine, then no, although you can minimize that work by exposing a single object through which script code can access the rest. The Good luck! |
Beta Was this translation helpful? Give feedback.
Hi @the-byte-bender,
A
Document
instance represents a script, module, or other file retrieved from a specific location. It's the principal data type returned from a document loader, so if you're implementing a custom document loader, you'll be dealing directly with these objects. ClearScript provides a default document loader that retrieves documents from the file system and the web, and most hosts just use that.If you're asking whether you can expose a specific host object or type in multiple script engines, then…