summaryrefslogtreecommitdiff
path: root/tests/node_compat/test/parallel/test-vm-symbols.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/node_compat/test/parallel/test-vm-symbols.js')
-rw-r--r--tests/node_compat/test/parallel/test-vm-symbols.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/node_compat/test/parallel/test-vm-symbols.js b/tests/node_compat/test/parallel/test-vm-symbols.js
new file mode 100644
index 000000000..fbaff6a82
--- /dev/null
+++ b/tests/node_compat/test/parallel/test-vm-symbols.js
@@ -0,0 +1,30 @@
+// deno-fmt-ignore-file
+// deno-lint-ignore-file
+
+// Copyright Joyent and Node contributors. All rights reserved. MIT license.
+// Taken from Node 18.12.1
+// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually.
+
+'use strict';
+
+require('../common');
+const assert = require('assert');
+
+const vm = require('vm');
+
+const symbol = Symbol();
+
+function Document() {
+ this[symbol] = 'foo';
+}
+
+Document.prototype.getSymbolValue = function() {
+ return this[symbol];
+};
+
+const context = new Document();
+vm.createContext(context);
+
+assert.strictEqual(context.getSymbolValue(), 'foo');
+
+assert.strictEqual(vm.runInContext('this.getSymbolValue()', context), 'foo');