// again when we upgrade.
V8::SetFlagsFromString("--noharmony_classes",
sizeof("--noharmony_classes") - 1);
+ V8::SetFlagsFromString("--noharmony_object_literals",
+ sizeof("--noharmony_object_literals") - 1);
#if defined(NODE_V8_OPTIONS)
// Should come before the call to V8::SetFlagsFromCommandLine()
var cp = spawnSync(process.execPath, args);
assert.equal(cp.status, 0);
assert.equal(cp.stdout.toString('utf8').trim(), '[Function: C]');
+
+// Now do the same for --harmony_object_literals.
+assert.throws(function() { eval('({ f() {} })'); }, SyntaxError);
+v8.setFlagsFromString('--harmony_object_literals');
+eval('({ f() {} })');
+
+var args = ['--harmony_object_literals', '-p', '({ f() {} })'];
+var cp = spawnSync(process.execPath, args);
+assert.equal(cp.status, 0);
+assert.equal(cp.stdout.toString('utf8').trim(), '{ f: [Function: f] }');