endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
829 stars 72 forks source link

fix: Support absence of TextEncoder/TextDecoder/console #1820

Closed gibson042 closed 1 year ago

gibson042 commented 1 year ago

Fix #1819

Description

Tolerate the absence of non-ECMA-262 web platform APIs.

Security Considerations

This follows existing patterns and hardens all introduced new non-primitive values. It will result in calls to a global print function that would not have otherwise happened, but only when it exists and console is undefined (but I believe any code capable of creating those circumstances could have overridden console anyway).

Scaling Considerations

n/a

Documentation Considerations

The non-web-platform environments of eshost invocations are sufficiently esoteric that I don't think documentation needs updating.

Testing Considerations

For similar reasons, I have not introduced new tests (although I suspect that could be done).

Upgrade Considerations

None.