Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
9cd33805
Unverified
Commit
9cd33805
authored
May 27, 2019
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vendor: update go-duktape to v2.3.0
parent
fc85777a
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
4238 additions
and
2398 deletions
+4238
-2398
api.go
vendor/gopkg.in/olebedev/go-duktape.v3/api.go
+29
-21
conts.go
vendor/gopkg.in/olebedev/go-duktape.v3/conts.go
+75
-73
duk_alloc_pool.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_alloc_pool.h
+8
-0
duk_config.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_config.h
+62
-72
duk_console.c
vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c
+28
-12
duk_console.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.h
+17
-2
duk_logging.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_logging.h
+9
-1
duk_minimal_printf.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_minimal_printf.h
+8
-0
duk_module_duktape.c
vendor/gopkg.in/olebedev/go-duktape.v3/duk_module_duktape.c
+2
-2
duk_module_duktape.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_module_duktape.h
+8
-0
duk_module_node.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_module_node.h
+8
-0
duk_print_alert.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_print_alert.h
+8
-0
duk_v1_compat.h
vendor/gopkg.in/olebedev/go-duktape.v3/duk_v1_compat.h
+8
-0
duktape.c
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.c
+3857
-2174
duktape.go
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.go
+1
-1
duktape.h
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.h
+107
-37
vendor.json
vendor/vendor.json
+3
-3
No files found.
vendor/gopkg.in/olebedev/go-duktape.v3/api.go
View file @
9cd33805
...
...
@@ -247,16 +247,16 @@ func (d *Context) CompileFile(flags uint, path string) {
}
// See: http://duktape.org/api.html#duk_compile_lstring
func
(
d
*
Context
)
CompileLstring
(
flags
uint
,
src
string
,
len
int
)
{
func
(
d
*
Context
)
CompileLstring
(
flags
uint
,
src
string
,
len
ght
int
)
{
__src__
:=
C
.
CString
(
src
)
C
.
_duk_compile_lstring
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
))
C
.
_duk_compile_lstring
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
ght
))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
}
// See: http://duktape.org/api.html#duk_compile_lstring_filename
func
(
d
*
Context
)
CompileLstringFilename
(
flags
uint
,
src
string
,
len
int
)
{
func
(
d
*
Context
)
CompileLstringFilename
(
flags
uint
,
src
string
,
len
ght
int
)
{
__src__
:=
C
.
CString
(
src
)
C
.
_duk_compile_lstring_filename
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
))
C
.
_duk_compile_lstring_filename
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
ght
))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
}
...
...
@@ -395,16 +395,16 @@ func (d *Context) EvalFileNoresult(path string) {
}
// See: http://duktape.org/api.html#duk_eval_lstring
func
(
d
*
Context
)
EvalLstring
(
src
string
,
len
int
)
{
func
(
d
*
Context
)
EvalLstring
(
src
string
,
len
ght
int
)
{
__src__
:=
C
.
CString
(
src
)
C
.
_duk_eval_lstring
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
))
C
.
_duk_eval_lstring
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
ght
))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
}
// See: http://duktape.org/api.html#duk_eval_lstring_noresult
func
(
d
*
Context
)
EvalLstringNoresult
(
src
string
,
len
int
)
{
func
(
d
*
Context
)
EvalLstringNoresult
(
src
string
,
len
ght
int
)
{
__src__
:=
C
.
CString
(
src
)
C
.
_duk_eval_lstring_noresult
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
))
C
.
_duk_eval_lstring_noresult
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
ght
))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
}
...
...
@@ -801,17 +801,17 @@ func (d *Context) PcompileFile(flags uint, path string) error {
}
// See: http://duktape.org/api.html#duk_pcompile_lstring
func
(
d
*
Context
)
PcompileLstring
(
flags
uint
,
src
string
,
len
int
)
error
{
func
(
d
*
Context
)
PcompileLstring
(
flags
uint
,
src
string
,
len
ght
int
)
error
{
__src__
:=
C
.
CString
(
src
)
result
:=
int
(
C
.
_duk_pcompile_lstring
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
)))
result
:=
int
(
C
.
_duk_pcompile_lstring
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
ght
)))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
return
d
.
castStringToError
(
result
)
}
// See: http://duktape.org/api.html#duk_pcompile_lstring_filename
func
(
d
*
Context
)
PcompileLstringFilename
(
flags
uint
,
src
string
,
len
int
)
error
{
func
(
d
*
Context
)
PcompileLstringFilename
(
flags
uint
,
src
string
,
len
ght
int
)
error
{
__src__
:=
C
.
CString
(
src
)
result
:=
int
(
C
.
_duk_pcompile_lstring_filename
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
)))
result
:=
int
(
C
.
_duk_pcompile_lstring_filename
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
,
C
.
duk_size_t
(
len
ght
)))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
return
d
.
castStringToError
(
result
)
}
...
...
@@ -821,8 +821,7 @@ func (d *Context) PcompileString(flags uint, src string) error {
__src__
:=
C
.
CString
(
src
)
result
:=
int
(
C
.
_duk_pcompile_string
(
d
.
duk_context
,
C
.
duk_uint_t
(
flags
),
__src__
))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
fmt
.
Println
(
"result herhehreh"
,
result
)
return
nil
//d.castStringToError(result)
return
d
.
castStringToError
(
result
)
}
// See: http://duktape.org/api.html#duk_pcompile_string_filename
...
...
@@ -856,18 +855,18 @@ func (d *Context) PevalFileNoresult(path string) int {
}
// See: http://duktape.org/api.html#duk_peval_lstring
func
(
d
*
Context
)
PevalLstring
(
src
string
,
len
int
)
error
{
func
(
d
*
Context
)
PevalLstring
(
src
string
,
len
ght
int
)
error
{
__src__
:=
C
.
CString
(
src
)
result
:=
int
(
C
.
_duk_peval_lstring
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
)))
result
:=
int
(
C
.
_duk_peval_lstring
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
ght
)))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
return
d
.
castStringToError
(
result
)
}
// See: http://duktape.org/api.html#duk_peval_lstring_noresult
func
(
d
*
Context
)
PevalLstringNoresult
(
src
string
,
len
int
)
int
{
func
(
d
*
Context
)
PevalLstringNoresult
(
src
string
,
len
ght
int
)
int
{
__src__
:=
C
.
CString
(
src
)
result
:=
int
(
C
.
_duk_peval_lstring_noresult
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
)))
result
:=
int
(
C
.
_duk_peval_lstring_noresult
(
d
.
duk_context
,
__src__
,
C
.
duk_size_t
(
len
ght
)))
C
.
free
(
unsafe
.
Pointer
(
__src__
))
return
result
}
...
...
@@ -1040,10 +1039,10 @@ func (d *Context) PushInt(val int) {
}
// See: http://duktape.org/api.html#duk_push_lstring
func
(
d
*
Context
)
PushLstring
(
str
string
,
len
int
)
string
{
func
(
d
*
Context
)
PushLstring
(
str
string
,
len
ght
int
)
string
{
__str__
:=
C
.
CString
(
str
)
var
result
string
if
s
:=
C
.
duk_push_lstring
(
d
.
duk_context
,
__str__
,
C
.
duk_size_t
(
len
));
s
!=
nil
{
if
s
:=
C
.
duk_push_lstring
(
d
.
duk_context
,
__str__
,
C
.
duk_size_t
(
len
ght
));
s
!=
nil
{
result
=
C
.
GoString
(
s
)
}
C
.
free
(
unsafe
.
Pointer
(
__str__
))
...
...
@@ -1590,6 +1589,16 @@ func (d *Context) PushExternalBuffer() {
C
.
_duk_push_external_buffer
(
d
.
duk_context
)
}
// See: http://duktape.org/api.html#duk_config_buffer
func
(
d
*
Context
)
ConfigBuffer
(
bufferIdx
int
,
buffer
[]
byte
)
{
C
.
duk_config_buffer
(
d
.
duk_context
,
C
.
duk_idx_t
(
bufferIdx
),
unsafe
.
Pointer
(
&
buffer
[
0
]),
C
.
duk_size_t
(
len
(
buffer
)),
)
}
/**
* Unimplemented.
*
...
...
@@ -1608,7 +1617,6 @@ func (d *Context) PushExternalBuffer() {
* Realloc see: http://duktape.org/api.html#duk_realloc
* ReallocRaw see: http://duktape.org/api.html#duk_realloc_raw
* RequireCFunction see: http://duktape.org/api.html#duk_require_c_function
* ConfigBuffer see: http://duktape.org/api.html#duk_config_buffer
* GetBufferData see: http://duktape.org/api.html#duk_get_buffer_data
* StealBuffer see: http://duktape.org/api.html#duk_steal_buffer
* RequireBufferData see: http://duktape.org/api.html#duk_require_buffer_data
...
...
vendor/gopkg.in/olebedev/go-duktape.v3/conts.go
View file @
9cd33805
package
duktape
/*
#cgo !windows CFLAGS: -std=c99 -O3 -Wall -Wno-unused-value -fomit-frame-pointer -fstrict-aliasing
#cgo windows CFLAGS: -O3 -Wall -Wno-unused-value -fomit-frame-pointer -fstrict-aliasing
#include "duktape.h"
*/
import
"C"
const
(
CompileEval
uint
=
1
<<
iota
CompileFunction
CompileStrict
CompileSafe
CompileNoResult
CompileNoSource
CompileStrlen
CompileEval
uint
=
C
.
DUK_COMPILE_EVAL
CompileFunction
uint
=
C
.
DUK_COMPILE_FUNCTION
CompileStrict
uint
=
C
.
DUK_COMPILE_STRICT
CompileShebang
uint
=
C
.
DUK_COMPILE_SHEBANG
CompileSafe
uint
=
C
.
DUK_COMPILE_SAFE
CompileNoResult
uint
=
C
.
DUK_COMPILE_NORESULT
CompileNoSource
uint
=
C
.
DUK_COMPILE_NOSOURCE
CompileStrlen
uint
=
C
.
DUK_COMPILE_STRLEN
CompileNoFileName
uint
=
C
.
DUK_COMPILE_NOFILENAME
CompileFuncExpr
uint
=
C
.
DUK_COMPILE_FUNCEXPR
)
const
(
TypeNone
Type
=
iota
TypeUndefined
TypeNull
TypeBoolean
TypeNumber
TypeString
TypeObject
TypeBuffer
TypePointer
TypeLightFunc
TypeNone
Type
=
C
.
DUK_TYPE_NONE
TypeUndefined
Type
=
C
.
DUK_TYPE_UNDEFINED
TypeNull
Type
=
C
.
DUK_TYPE_NULL
TypeBoolean
Type
=
C
.
DUK_TYPE_BOOLEAN
TypeNumber
Type
=
C
.
DUK_TYPE_NUMBER
TypeString
Type
=
C
.
DUK_TYPE_STRING
TypeObject
Type
=
C
.
DUK_TYPE_OBJECT
TypeBuffer
Type
=
C
.
DUK_TYPE_BUFFER
TypePointer
Type
=
C
.
DUK_TYPE_POINTER
TypeLightFunc
Type
=
C
.
DUK_TYPE_LIGHTFUNC
)
const
(
TypeMaskNone
uint
=
1
<<
iota
TypeMaskUndefined
TypeMaskNull
TypeMaskBoolean
TypeMaskNumber
TypeMaskString
TypeMaskObject
TypeMaskBuffer
TypeMaskPointer
TypeMaskLightFunc
TypeMaskNone
uint
=
C
.
DUK_TYPE_MASK_NONE
TypeMaskUndefined
uint
=
C
.
DUK_TYPE_MASK_UNDEFINED
TypeMaskNull
uint
=
C
.
DUK_TYPE_MASK_NULL
TypeMaskBoolean
uint
=
C
.
DUK_TYPE_MASK_BOOLEAN
TypeMaskNumber
uint
=
C
.
DUK_TYPE_MASK_NUMBER
TypeMaskString
uint
=
C
.
DUK_TYPE_MASK_STRING
TypeMaskObject
uint
=
C
.
DUK_TYPE_MASK_OBJECT
TypeMaskBuffer
uint
=
C
.
DUK_TYPE_MASK_BUFFER
TypeMaskPointer
uint
=
C
.
DUK_TYPE_MASK_POINTER
TypeMaskLightFunc
uint
=
C
.
DUK_TYPE_MASK_LIGHTFUNC
)
const
(
EnumIncludeNonenumerable
uint
=
1
<<
iota
EnumIncludeInternal
EnumOwnPropertiesOnly
EnumArrayIndicesOnly
EnumSortArrayIndices
NoProxyBehavior
EnumIncludeNonenumerable
uint
=
C
.
DUK_ENUM_INCLUDE_NONENUMERABLE
EnumIncludeHidden
uint
=
C
.
DUK_ENUM_INCLUDE_HIDDEN
EnumIncludeSymbols
uint
=
C
.
DUK_ENUM_INCLUDE_SYMBOLS
EnumExcludeStrings
uint
=
C
.
DUK_ENUM_EXCLUDE_STRINGS
EnumOwnPropertiesOnly
uint
=
C
.
DUK_ENUM_OWN_PROPERTIES_ONLY
EnumArrayIndicesOnly
uint
=
C
.
DUK_ENUM_ARRAY_INDICES_ONLY
EnumSortArrayIndices
uint
=
C
.
DUK_ENUM_SORT_ARRAY_INDICES
NoProxyBehavior
uint
=
C
.
DUK_ENUM_NO_PROXY_BEHAVIOR
)
const
(
ErrNone
int
=
0
// Internal to Duktape
ErrUnimplemented
int
=
50
+
iota
ErrUnsupported
ErrInternal
ErrAlloc
ErrAssertion
ErrAPI
ErrUncaughtError
)
const
(
// Common prototypes
ErrError
int
=
1
+
iota
ErrEval
ErrRange
ErrReference
ErrSyntax
ErrType
ErrURI
ErrNone
int
=
C
.
DUK_ERR_NONE
ErrError
int
=
C
.
DUK_ERR_ERROR
ErrEval
int
=
C
.
DUK_ERR_EVAL_ERROR
ErrRange
int
=
C
.
DUK_ERR_RANGE_ERROR
ErrReference
int
=
C
.
DUK_ERR_REFERENCE_ERROR
ErrSyntax
int
=
C
.
DUK_ERR_SYNTAX_ERROR
ErrType
int
=
C
.
DUK_ERR_TYPE_ERROR
ErrURI
int
=
C
.
DUK_ERR_URI_ERROR
)
const
(
...
...
@@ -81,18 +84,18 @@ const (
)
const
(
ErrRetError
int
=
-
(
ErrError
+
iota
)
ErrRetEval
ErrRetRange
ErrRetReference
ErrRetSyntax
ErrRetType
ErrRetURI
ErrRetError
int
=
-
(
ErrError
)
ErrRetEval
int
=
-
(
ErrEval
)
ErrRetRange
int
=
-
(
ErrRange
)
ErrRetReference
int
=
-
(
ErrReference
)
ErrRetSyntax
int
=
-
(
ErrSyntax
)
ErrRetType
int
=
-
(
ErrType
)
ErrRetURI
int
=
-
(
ErrURI
)
)
const
(
ExecSuccess
=
iota
ExecError
ExecSuccess
int
=
C
.
DUK_EXEC_SUCCESS
ExecError
int
=
C
.
DUK_EXEC_ERROR
)
const
(
...
...
@@ -105,17 +108,16 @@ const (
)
const
(
BufobjDuktapeAuffer
=
0
BufobjNodejsAuffer
=
1
BufobjArraybuffer
=
2
BufobjDataview
=
3
BufobjInt8array
=
4
BufobjUint8array
=
5
BufobjUint8clampedarray
=
6
BufobjInt16array
=
7
BufobjUint16array
=
8
BufobjInt32array
=
9
BufobjUint32array
=
10
BufobjFloat32array
=
11
BufobjFloat64array
=
12
BufObjArrayBuffer
int
=
C
.
DUK_BUFOBJ_ARRAYBUFFER
BufObjNodejsBuffer
int
=
C
.
DUK_BUFOBJ_NODEJS_BUFFER
BufObjDataView
int
=
C
.
DUK_BUFOBJ_DATAVIEW
BufobjInt8Array
int
=
C
.
DUK_BUFOBJ_INT8ARRAY
BufobjUint8Array
int
=
C
.
DUK_BUFOBJ_UINT8ARRAY
BufobjUint8ClampedArray
int
=
C
.
DUK_BUFOBJ_UINT8CLAMPEDARRAY
BufObjInt16Array
int
=
C
.
DUK_BUFOBJ_INT16ARRAY
BufObjUint16Array
int
=
C
.
DUK_BUFOBJ_UINT16ARRAY
BufObjInt32Array
int
=
C
.
DUK_BUFOBJ_INT32ARRAY
BufObjUint32Array
int
=
C
.
DUK_BUFOBJ_UINT32ARRAY
BufObjFloat32Array
int
=
C
.
DUK_BUFOBJ_FLOAT32ARRAY
BufObjFloat64Array
int
=
C
.
DUK_BUFOBJ_FLOAT64ARRAY
)
vendor/gopkg.in/olebedev/go-duktape.v3/duk_alloc_pool.h
View file @
9cd33805
...
...
@@ -3,6 +3,10 @@
#include "duktape.h"
#if defined(__cplusplus)
extern
"C"
{
#endif
/* 32-bit (big endian) marker used at the end of pool entries so that wasted
* space can be detected. Waste tracking must be enabled explicitly.
*/
...
...
@@ -220,4 +224,8 @@ static DUK__ALLOC_POOL_ALWAYS_INLINE void *duk_alloc_pool_dec16(duk_uint16_t val
}
#endif
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_ALLOC_POOL_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_config.h
View file @
9cd33805
This diff is collapsed.
Click to expand it.
vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.c
View file @
9cd33805
...
...
@@ -13,10 +13,6 @@
/* XXX: Add some form of log level filtering. */
/* XXX: For now logs everything to stdout, V8/Node.js logs debug/info level
* to stdout, warn and above to stderr. Should this extra do the same?
*/
/* XXX: Should all output be written via e.g. console.write(formattedMsg)?
* This would make it easier for user code to redirect all console output
* to a custom backend.
...
...
@@ -25,12 +21,10 @@
/* XXX: Init console object using duk_def_prop() when that call is available. */
static
duk_ret_t
duk__console_log_helper
(
duk_context
*
ctx
,
const
char
*
error_name
)
{
duk_idx_t
i
,
n
;
duk_uint_t
flags
;
flags
=
(
duk_uint_t
)
duk_get_current_magic
(
ctx
);
n
=
duk_get_top
(
ctx
);
duk_uint_t
flags
=
(
duk_uint_t
)
duk_get_current_magic
(
ctx
);
FILE
*
output
=
(
flags
&
DUK_CONSOLE_STDOUT_ONLY
)
?
stdout
:
stderr
;
duk_idx_t
n
=
duk_get_top
(
ctx
);
duk_idx_t
i
;
duk_get_global_string
(
ctx
,
"console"
);
duk_get_prop_string
(
ctx
,
-
1
,
"format"
);
...
...
@@ -59,9 +53,9 @@ static duk_ret_t duk__console_log_helper(duk_context *ctx, const char *error_nam
duk_get_prop_string
(
ctx
,
-
1
,
"stack"
);
}
fprintf
(
stdo
ut
,
"%s
\n
"
,
duk_to_string
(
ctx
,
-
1
));
fprintf
(
outp
ut
,
"%s
\n
"
,
duk_to_string
(
ctx
,
-
1
));
if
(
flags
&
DUK_CONSOLE_FLUSH
)
{
fflush
(
stdo
ut
);
fflush
(
outp
ut
);
}
return
0
;
}
...
...
@@ -110,6 +104,17 @@ static void duk__console_reg_vararg_func(duk_context *ctx, duk_c_function func,
}
void
duk_console_init
(
duk_context
*
ctx
,
duk_uint_t
flags
)
{
duk_uint_t
flags_orig
;
/* If both DUK_CONSOLE_STDOUT_ONLY and DUK_CONSOLE_STDERR_ONLY where specified,
* just turn off DUK_CONSOLE_STDOUT_ONLY and keep DUK_CONSOLE_STDERR_ONLY.
*/
if
((
flags
&
DUK_CONSOLE_STDOUT_ONLY
)
&&
(
flags
&
DUK_CONSOLE_STDERR_ONLY
))
{
flags
&=
~
DUK_CONSOLE_STDOUT_ONLY
;
}
/* Remember the (possibly corrected) flags we received. */
flags_orig
=
flags
;
duk_push_object
(
ctx
);
/* Custom function to format objects; user can replace.
...
...
@@ -128,11 +133,22 @@ void duk_console_init(duk_context *ctx, duk_uint_t flags) {
"})(Duktape.enc)"
);
duk_put_prop_string
(
ctx
,
-
2
,
"format"
);
flags
=
flags_orig
;
if
(
!
(
flags
&
DUK_CONSOLE_STDOUT_ONLY
)
&&
!
(
flags
&
DUK_CONSOLE_STDERR_ONLY
))
{
/* No output indicators were specified; these levels go to stdout. */
flags
|=
DUK_CONSOLE_STDOUT_ONLY
;
}
duk__console_reg_vararg_func
(
ctx
,
duk__console_assert
,
"assert"
,
flags
);
duk__console_reg_vararg_func
(
ctx
,
duk__console_log
,
"log"
,
flags
);
duk__console_reg_vararg_func
(
ctx
,
duk__console_log
,
"debug"
,
flags
);
/* alias to console.log */
duk__console_reg_vararg_func
(
ctx
,
duk__console_trace
,
"trace"
,
flags
);
duk__console_reg_vararg_func
(
ctx
,
duk__console_info
,
"info"
,
flags
);
flags
=
flags_orig
;
if
(
!
(
flags
&
DUK_CONSOLE_STDOUT_ONLY
)
&&
!
(
flags
&
DUK_CONSOLE_STDERR_ONLY
))
{
/* No output indicators were specified; these levels go to stderr. */
flags
|=
DUK_CONSOLE_STDERR_ONLY
;
}
duk__console_reg_vararg_func
(
ctx
,
duk__console_warn
,
"warn"
,
flags
);
duk__console_reg_vararg_func
(
ctx
,
duk__console_error
,
"error"
,
flags
);
duk__console_reg_vararg_func
(
ctx
,
duk__console_error
,
"exception"
,
flags
);
/* alias to console.error */
...
...
vendor/gopkg.in/olebedev/go-duktape.v3/duk_console.h
View file @
9cd33805
...
...
@@ -3,12 +3,27 @@
#include "duktape.h"
#if defined(__cplusplus)
extern
"C"
{
#endif
/* Use a proxy wrapper to make undefined methods (console.foo()) no-ops. */
#define DUK_CONSOLE_PROXY_WRAPPER (1 << 0)
#define DUK_CONSOLE_PROXY_WRAPPER (1
U
<< 0)
/* Flush output after every call. */
#define DUK_CONSOLE_FLUSH (1 << 1)
#define DUK_CONSOLE_FLUSH (1U << 1)
/* Send output to stdout only (default is mixed stdout/stderr). */
#define DUK_CONSOLE_STDOUT_ONLY (1U << 2)
/* Send output to stderr only (default is mixed stdout/stderr). */
#define DUK_CONSOLE_STDERR_ONLY (1U << 3)
/* Initialize the console system */
extern
void
duk_console_init
(
duk_context
*
ctx
,
duk_uint_t
flags
);
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_CONSOLE_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_logging.h
View file @
9cd33805
...
...
@@ -3,7 +3,11 @@
#include "duktape.h"
/* Log levels */
#if defined(__cplusplus)
extern
"C"
{
#endif
/* Log levels. */
#define DUK_LOG_TRACE 0
#define DUK_LOG_DEBUG 1
#define DUK_LOG_INFO 2
...
...
@@ -17,4 +21,8 @@ extern void duk_logging_init(duk_context *ctx, duk_uint_t flags);
extern
void
duk_log_va
(
duk_context
*
ctx
,
duk_int_t
level
,
const
char
*
fmt
,
va_list
ap
);
extern
void
duk_log
(
duk_context
*
ctx
,
duk_int_t
level
,
const
char
*
fmt
,
...);
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_LOGGING_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_minimal_printf.h
View file @
9cd33805
...
...
@@ -4,9 +4,17 @@
#include <stdarg.h>
/* va_list etc */
#include <stddef.h>
/* size_t */
#if defined(__cplusplus)
extern
"C"
{
#endif
extern
int
duk_minimal_sprintf
(
char
*
str
,
const
char
*
format
,
...);
extern
int
duk_minimal_snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...);
extern
int
duk_minimal_vsnprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
va_list
ap
);
extern
int
duk_minimal_sscanf
(
const
char
*
str
,
const
char
*
format
,
...);
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_MINIMAL_PRINTF_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_module_duktape.c
View file @
9cd33805
...
...
@@ -263,7 +263,7 @@ static duk_ret_t duk__require(duk_context *ctx) {
* done with Object.defineProperty().
*
* XXX: require.id could also be just made non-configurable, as there
* is no practical reason to touch it (at least from E
cmas
cript code).
* is no practical reason to touch it (at least from E
CMAS
cript code).
*/
duk_push_c_function
(
ctx
,
duk__require
,
1
/*nargs*/
);
duk_push_string
(
ctx
,
"name"
);
...
...
@@ -307,7 +307,7 @@ static duk_ret_t duk__require(duk_context *ctx) {
* Call user provided module search function and build the wrapped
* module source code (if necessary). The module search function
* can be used to implement pure Ecmacsript, pure C, and mixed
* E
cmas
cript/C modules.
* E
CMAS
cript/C modules.
*
* The module search function can operate on the exports table directly
* (e.g. DLL code can register values to it). It can also return a
...
...
vendor/gopkg.in/olebedev/go-duktape.v3/duk_module_duktape.h
View file @
9cd33805
...
...
@@ -3,6 +3,10 @@
#include "duktape.h"
#if defined(__cplusplus)
extern
"C"
{
#endif
/* Maximum length of CommonJS module identifier to resolve. Length includes
* both current module ID, requested (possibly relative) module ID, and a
* slash in between.
...
...
@@ -11,4 +15,8 @@
extern
void
duk_module_duktape_init
(
duk_context
*
ctx
);
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_MODULE_DUKTAPE_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_module_node.h
View file @
9cd33805
...
...
@@ -3,7 +3,15 @@
#include "duktape.h"
#if defined(__cplusplus)
extern
"C"
{
#endif
extern
duk_ret_t
duk_module_node_peval_main
(
duk_context
*
ctx
,
const
char
*
path
);
extern
void
duk_module_node_init
(
duk_context
*
ctx
);
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_MODULE_NODE_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_print_alert.h
View file @
9cd33805
...
...
@@ -3,8 +3,16 @@
#include "duktape.h"
#if defined(__cplusplus)
extern
"C"
{
#endif
/* No flags at the moment. */
extern
void
duk_print_alert_init
(
duk_context
*
ctx
,
duk_uint_t
flags
);
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_PRINT_ALERT_H_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duk_v1_compat.h
View file @
9cd33805
...
...
@@ -3,6 +3,10 @@
#include "duktape.h"
#if defined(__cplusplus)
extern
"C"
{
#endif
/* Straight flag rename */
#if !defined(DUK_ENUM_INCLUDE_INTERNAL)
#define DUK_ENUM_INCLUDE_INTERNAL DUK_ENUM_INCLUDE_HIDDEN
...
...
@@ -25,4 +29,8 @@ extern void duk_to_defaultvalue(duk_context *ctx, duk_idx_t idx, duk_int_t hint)
#define duk_push_string_file(ctx,path) \
duk_push_string_file_raw((ctx), (path), 0)
#if defined(__cplusplus)
}
#endif
/* end 'extern "C"' wrapper */
#endif
/* DUK_V1_COMPAT_INCLUDED */
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.c
View file @
9cd33805
This diff is collapsed.
Click to expand it.
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.go
View file @
9cd33805
...
...
@@ -199,7 +199,7 @@ func (e *Error) Error() string {
return
fmt
.
Sprintf
(
"%s: %s"
,
e
.
Type
,
e
.
Message
)
}
type
Type
int
type
Type
u
int
func
(
t
Type
)
IsNone
()
bool
{
return
t
==
TypeNone
}
func
(
t
Type
)
IsUndefined
()
bool
{
return
t
==
TypeUndefined
}
...
...
vendor/gopkg.in/olebedev/go-duktape.v3/duktape.h
View file @
9cd33805
This diff is collapsed.
Click to expand it.
vendor/vendor.json
View file @
9cd33805
...
...
@@ -941,10 +941,10 @@
"revisionTime"
:
"2016-06-21T03:49:01Z"
},
{
"checksumSHA1"
:
"
vndxs5Tv09/8S+Dr2PBAiM557lI
="
,
"checksumSHA1"
:
"
h+m6mYCZIKnMQI24faKak5o19es
="
,
"path"
:
"gopkg.in/olebedev/go-duktape.v3"
,
"revision"
:
"
abf0ba0be5d5d36b1f9266463cc320b9a5ab224e
"
,
"revisionTime"
:
"201
8-03-02T12:15:09
Z"
"revision"
:
"
ec84240a7772c7a122b1c58a13398210659f7c40
"
,
"revisionTime"
:
"201
9-02-13T23:42:57
Z"
},
{
"checksumSHA1"
:
"4BwmmgQUhWtizsR2soXND0nqZ1I="
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment