diff options
author | Domenic Denicola <domenic@domenicdenicola.com> | 2013-08-24 18:53:24 -0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-08-28 22:27:24 -0700 |
commit | fd3657610e49005dfc778c3f060dbba0a34f286a (patch) | |
tree | b6f5dec4b403e544e54f1898fc4f65177c1b94ef /test/message/vm_display_syntax_error.js | |
parent | de7d698df7d2e840d079336606d56cdaf9ee9c03 (diff) | |
download | android-node-v8-fd3657610e49005dfc778c3f060dbba0a34f286a.tar.gz android-node-v8-fd3657610e49005dfc778c3f060dbba0a34f286a.tar.bz2 android-node-v8-fd3657610e49005dfc778c3f060dbba0a34f286a.zip |
vm: update API to use options argument
Passing a filename is still supported in place of certain options
arguments, for backward-compatibility, but timeout and display-errors
are not translated since those were undocumented.
Also managed to eliminate an extra stack trace line by not calling
through the `createScript` export.
Added a few message tests to show how `displayErrors` works.
Diffstat (limited to 'test/message/vm_display_syntax_error.js')
-rw-r--r-- | test/message/vm_display_syntax_error.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/message/vm_display_syntax_error.js b/test/message/vm_display_syntax_error.js new file mode 100644 index 0000000000..d862f4121d --- /dev/null +++ b/test/message/vm_display_syntax_error.js @@ -0,0 +1,30 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var common = require('../common'); +var assert = require('assert'); +var vm = require('vm'); + +console.error('beginning'); + +vm.runInThisContext('var 5;', { filename: 'test.vm' }); + +console.error('end'); |