mirror of
https://github.com/robertkrimen/otto
synced 2025-10-12 20:27:30 +08:00
27 lines
536 B
Go
27 lines
536 B
Go
package otto
|
|
|
|
import (
|
|
. "github.com/robertkrimen/terst"
|
|
"testing"
|
|
)
|
|
|
|
func TestStash(t *testing.T) {
|
|
Terst(t)
|
|
|
|
stash := newObjectStash(true)
|
|
IsTrue(stash.canPut("xyzzy"))
|
|
|
|
//stash.define("xyzzy", _defineProperty{
|
|
// Value: toValue("Nothing happens."),
|
|
//})
|
|
//IsTrue(stash.test("xyzzy"))
|
|
//IsTrue(stash.canPut("xyzzy"))
|
|
|
|
//stash.define("xyzzy", _defineProperty{
|
|
// Value: toValue("Something else happens."),
|
|
// Write: propertyAttributeFalse,
|
|
//})
|
|
//IsTrue(stash.test("xyzzy"))
|
|
//IsFalse(stash.canPut("xyzzy"))
|
|
}
|