diff options
author | Felix Lange <fjl@twurst.com> | 2017-02-16 20:21:11 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-02-16 20:44:09 +0800 |
commit | 2c4455b12aca82ccd29c05c1750c25430867e545 (patch) | |
tree | 0beb8c96c7bf6a5a82434ed79218e822927434c3 /vendor/github.com/robertkrimen/otto | |
parent | c8695fae359aa327da9203a57ffaf4f2d47d4370 (diff) | |
download | dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.gz dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.bz2 dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.lz dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.xz dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.zst dexon-2c4455b12aca82ccd29c05c1750c25430867e545.zip |
vendor: update dependencies with github.com/kardianos/govendor
Diffstat (limited to 'vendor/github.com/robertkrimen/otto')
6 files changed, 14 insertions, 10 deletions
diff --git a/vendor/github.com/robertkrimen/otto/.gitignore b/vendor/github.com/robertkrimen/otto/.gitignore deleted file mode 100644 index 8c2a16949..000000000 --- a/vendor/github.com/robertkrimen/otto/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/.test -/otto/otto -/otto/otto-* -/test/test-*.js -/test/tester diff --git a/vendor/github.com/robertkrimen/otto/README.markdown b/vendor/github.com/robertkrimen/otto/README.markdown index ed14f0ae9..a1ae7d1ae 100644 --- a/vendor/github.com/robertkrimen/otto/README.markdown +++ b/vendor/github.com/robertkrimen/otto/README.markdown @@ -114,7 +114,7 @@ http://godoc.org/github.com/robertkrimen/otto/parser Parse and return an AST ```go -filenamee := "" // A filename is optional +filename := "" // A filename is optional src := ` // Sample xyzzy example (function(){ diff --git a/vendor/github.com/robertkrimen/otto/builtin.go b/vendor/github.com/robertkrimen/otto/builtin.go index 83f715083..256ee3c55 100644 --- a/vendor/github.com/robertkrimen/otto/builtin.go +++ b/vendor/github.com/robertkrimen/otto/builtin.go @@ -70,7 +70,7 @@ func digitValue(chr rune) int { } func builtinGlobal_parseInt(call FunctionCall) Value { - input := strings.TrimSpace(call.Argument(0).string()) + input := strings.Trim(call.Argument(0).string(), builtinString_trim_whitespace) if len(input) == 0 { return NaNValue() } @@ -153,7 +153,8 @@ var parseFloat_matchValid = regexp.MustCompile(`[0-9eE\+\-\.]|Infinity`) func builtinGlobal_parseFloat(call FunctionCall) Value { // Caveat emptor: This implementation does NOT match the specification - input := strings.TrimSpace(call.Argument(0).string()) + input := strings.Trim(call.Argument(0).string(), builtinString_trim_whitespace) + if parseFloat_matchBadSpecial.MatchString(input) { return NaNValue() } diff --git a/vendor/github.com/robertkrimen/otto/builtin_string.go b/vendor/github.com/robertkrimen/otto/builtin_string.go index f5f09fee1..6a1718458 100644 --- a/vendor/github.com/robertkrimen/otto/builtin_string.go +++ b/vendor/github.com/robertkrimen/otto/builtin_string.go @@ -380,7 +380,12 @@ func builtinString_split(call FunctionCall) Value { split = split[:limit] } - return call.runtime.toValue(split) + valueArray := make([]Value, len(split)) + for index, value := range split { + valueArray[index] = toValue_string(value) + } + + return toValue_object(call.runtime.newArrayOf(valueArray)) } } diff --git a/vendor/github.com/robertkrimen/otto/value_boolean.go b/vendor/github.com/robertkrimen/otto/value_boolean.go index 3040f4163..b631507b0 100644 --- a/vendor/github.com/robertkrimen/otto/value_boolean.go +++ b/vendor/github.com/robertkrimen/otto/value_boolean.go @@ -4,6 +4,7 @@ import ( "fmt" "math" "reflect" + "unicode/utf16" ) func (value Value) bool() bool { @@ -32,6 +33,8 @@ func (value Value) bool() bool { return true case string: return 0 != len(value) + case []uint16: + return 0 != len(utf16.Decode(value)) } if value.IsObject() { return true diff --git a/vendor/github.com/robertkrimen/otto/value_number.go b/vendor/github.com/robertkrimen/otto/value_number.go index 870bf115b..8cbf136d2 100644 --- a/vendor/github.com/robertkrimen/otto/value_number.go +++ b/vendor/github.com/robertkrimen/otto/value_number.go @@ -11,7 +11,7 @@ import ( var stringToNumberParseInteger = regexp.MustCompile(`^(?:0[xX])`) func parseNumber(value string) float64 { - value = strings.TrimSpace(value) + value = strings.Trim(value, builtinString_trim_whitespace) if value == "" { return 0 |