mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
3370e7c53a
Context's default IsCodeGenerationFromStringsAllowed value can be changed by v8 flag `--disallow-code-generation-from-strings`. Restore the value at runtime when delegating the code generation validation to `node::ModifyCodeGenerationFromStrings`. The context's settings are serialized in the snapshot. Reset the setting values to its default values before the serialization so that it can be correctly re-initialized after deserialization at runtime. PR-URL: https://github.com/nodejs/node/pull/44324 Fixes: https://github.com/nodejs/node/issues/44287 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
10 lines
257 B
JavaScript
10 lines
257 B
JavaScript
// Flags: --disallow-code-generation-from-strings
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
// Verify that v8 option --disallow-code-generation-from-strings is still
|
|
// respected
|
|
assert.throws(() => eval('"eval"'), EvalError);
|