1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Fix Date tests to always mock UTC

This commit is contained in:
Robert Krimen
2014-04-13 15:07:29 -07:00
parent ddca88af9b
commit 7721396b67
5 changed files with 118 additions and 66 deletions

View File

@@ -263,6 +263,8 @@ func (otto *Otto) clone() *Otto {
//
// src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST always be in UTF-8.
//
// src may also be a Script.
//
// src may also be a node, but if the AST has been modified, then runtime behavior is undefined.
//
func Run(src interface{}) (*Otto, Value, error) {
@@ -278,6 +280,8 @@ func Run(src interface{}) (*Otto, Value, error) {
// If the runtime is unable to parse source, then this function will return undefined and the parse error (nothing
// will be evaluated in this case).
//
// src may also be a Script.
//
// src may also be a node, but if the AST has been modified, then runtime behavior is undefined.
//
func (self Otto) Run(src interface{}) (Value, error) {