What is snarf in Javascript / ECMA?

I was looking through Mozilla JS code in JS and came across a snarf function . It is not defined in javascript, it seems only in version C here . However, this is not well commented. I googled it to no avail.

Is this the standard part of JavaScript? (My guess is not.) Is this some kind of extension? What should he do?

+3
source share
2 answers

No, this is not a standard. This is part of Mozilla Narcissus (JS in the JS interpreter is implemented on top of SpiderMonkey). snarf(filename)captures the contents of the file and returns it as a string for further processing (for example, evaluation).

+7

.

+2

All Articles