Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add no-op for --harmony-proxies flag #8395

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3801,6 +3801,12 @@ static void ParseArgs(int* argc,
} else if (strncmp(arg, "--icu-data-dir=", 15) == 0) {
icu_data_dir = arg + 15;
#endif
} else if (strcmp(arg, "--harmony-proxies") == 0 ||
strcmp(arg, "--harmony_proxies") == 0 ||
strcmp(arg, "-harmony-proxies") == 0 ||
strcmp(arg, "-harmony_proxies") == 0) {
// Keep V8 flags to make 5.0 -> 5.1 not breaking.
// This is only needed in v6.x.
} else if (strcmp(arg, "--expose-internals") == 0 ||
strcmp(arg, "--expose_internals") == 0) {
// consumed in js
Expand Down
21 changes: 17 additions & 4 deletions test/parallel/test-v8-flags.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';
require('../common');
var assert = require('assert');
var v8 = require('v8');
var vm = require('vm');
const common = require('../common');
const assert = require('assert');
const exec = require('child_process').execSync;
const v8 = require('v8');
const vm = require('vm');

// Note: changing V8 flags after an isolate started is not guaranteed to work.
// Specifically here, V8 may cache compiled scripts between the flip of the
Expand All @@ -14,3 +15,15 @@ assert(vm.runInThisContext('%_IsSmi(43)'));
v8.setFlagsFromString('--noallow_natives_syntax');
assert.throws(function() { eval('%_IsSmi(44)'); }, SyntaxError);
assert.throws(function() { vm.runInThisContext('%_IsSmi(45)'); }, SyntaxError);

// Verify that the --harmony-proxies flag doesn't error
const flags = ['--harmony-proxies',
'--harmony_proxies',
'-harmony-proxies',
'-harmony_proxies'];

for (const flag of flags) {
assert.doesNotThrow(common.mustCall(() => {
exec(`${process.execPath} ${flag}`)
}));
}