mirror of
https://github.com/robertkrimen/otto
synced 2025-09-28 18:45:22 +08:00
Move underscore into otto/underscore
This commit is contained in:
parent
2d707b5a97
commit
f8a0d426f2
|
@ -1,7 +1,10 @@
|
|||
package otto
|
||||
package underscore
|
||||
|
||||
// underscore_js returns the raw file data data.
|
||||
func underscore_js() []byte {
|
||||
func Source() string {
|
||||
return string(underscore())
|
||||
}
|
||||
|
||||
func underscore() []byte {
|
||||
return []byte{
|
||||
0x2f,0x2f,0x20,0x20,0x20,0x20,0x20,0x55,0x6e,0x64,0x65,0x72,
|
||||
0x73,0x63,0x6f,0x72,0x65,0x2e,0x6a,0x73,0x20,0x31,0x2e,0x33,
|
||||
|
@ -3220,4 +3223,4 @@ func underscore_js() []byte {
|
|||
0x2e,0x63,0x61,0x6c,0x6c,0x28,0x74,0x68,0x69,0x73,0x29,0x3b,
|
||||
0x0a,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,11 +3,12 @@ package otto
|
|||
import (
|
||||
"testing"
|
||||
. "github.com/robertkrimen/terst"
|
||||
"github.com/robertkrimen/otto/underscore"
|
||||
)
|
||||
|
||||
func underscoreTest() func(string, ... interface{}) Value {
|
||||
Otto, test := runTestWithOtto()
|
||||
Otto.Run(string(underscore_js()))
|
||||
Otto.Run(underscore.Source())
|
||||
|
||||
Otto.Set("assert", func(call FunctionCall) Value {
|
||||
if !toBoolean(call.Argument(0)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user