зеркало из https://github.com/microsoft/napajs.git
3211319d77
This change addresses issue to make zone.execute on anonymous function more fluent. Also it made transported functions more secure, which can only access their own v8 contexts. Detailed changes Support require(path, script) to create module from string in Napa zone. Introduce napa.v8.currentStack to get current stack. Replace eval with creating a new module for transported function. Use caller JS file + function hash as module id for transported function. As a result, transported function will use __dirname from caller. Updated test files. Notable comments We always assume that the function passed to zone.execute without property origin is to use caller file as origin. This assumption makes most fluent usage for most cases, but if functions are defined in different file other than caller, this assumption will be broken. User can explicit specify `f.origin = __filename' in the file where f is defined to avoid issue. Bug fixes Issue: require.resolve should throw on non-existed path. |
||
---|---|---|
.. | ||
core | ||
memory | ||
runtime | ||
store | ||
transport | ||
v8 | ||
zone | ||
binding.js | ||
index.ts | ||
log.ts | ||
memory.ts | ||
metric.ts | ||
runtime.ts | ||
store.ts | ||
transport.ts | ||
tsconfig.json | ||
v8.ts | ||
zone.ts |