mirror of
https://github.com/robertkrimen/otto
synced 2025-10-19 19:55:30 +08:00

Remove the dependencies on perl and make. inline.pl is replaced by tools/gen-jscore and token/tokenfmt is replaced by tools/gen-tokens which are both golang text/template utilities. gen-jscore uses property ordering that matches chromes output ordering adding missing properties to the Error types. Local generated documentation have been removed as https://pkg.go.dev/ is more feature rich. The use of make has been removed as the functionality is now replicated by standard golang tools go test ./... and go generate ./... as well as integrated into github actions.
32 lines
930 B
Cheetah
32 lines
930 B
Cheetah
&object{
|
|
runtime: rt,
|
|
class: classFunctionName,
|
|
objectClass: classObject,
|
|
prototype: rt.global.FunctionPrototype,
|
|
extensible: true,
|
|
property: map[string]property{
|
|
propertyLength: {
|
|
mode: 0,
|
|
value: Value{
|
|
kind: valueNumber,
|
|
value: {{if eq .Property.Function -1}}0{{else}}{{.Property.Function}}{{end}},
|
|
},
|
|
},
|
|
propertyName: {
|
|
mode: 0,
|
|
value: Value{
|
|
kind: valueString,
|
|
value: "{{.Property.Name}}",
|
|
},
|
|
},
|
|
},
|
|
propertyOrder: []string{
|
|
propertyLength,
|
|
propertyName,
|
|
},
|
|
value: nativeFunctionObject{
|
|
name: {{template "name.tmpl" .Property.Name}},
|
|
call: builtin{{if .Property.Call}}{{.Property.Call}}{{else}}{{.Name}}{{.Property.Name | ucfirst}}{{end}},
|
|
},
|
|
}{{/* No newline. */ -}}
|