mirror of
https://github.com/robertkrimen/otto.git
synced 2025-12-24 12:58:05 +08:00
Move underscore into otto/underscore
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user