mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Bug 846, SEE: Add checktype.c and checktype.h.
These should have been in commit 8bc3d7a798
.
This commit is contained in:
parent
a193632187
commit
846a8f9a4e
18
src/ecmascript/see/checktype.c
Normal file
18
src/ecmascript/see/checktype.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <see/see.h>
|
||||||
|
#include "ecmascript/see/checktype.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
see_check_class(struct SEE_interpreter *interp,
|
||||||
|
const struct SEE_object *object,
|
||||||
|
const struct SEE_objectclass *class)
|
||||||
|
{
|
||||||
|
if (object->objectclass != class)
|
||||||
|
SEE_error_throw(interp, interp->TypeError,
|
||||||
|
"got %s, expected %s",
|
||||||
|
object->objectclass->Class,
|
||||||
|
class->Class);
|
||||||
|
}
|
12
src/ecmascript/see/checktype.h
Normal file
12
src/ecmascript/see/checktype.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef EL__ECMASCRIPT_SEE_CHECKTYPE_H
|
||||||
|
#define EL__ECMASCRIPT_SEE_CHECKTYPE_H
|
||||||
|
|
||||||
|
struct SEE_interpreter;
|
||||||
|
struct SEE_object;
|
||||||
|
struct SEE_objectclass;
|
||||||
|
|
||||||
|
void see_check_class(struct SEE_interpreter *interp,
|
||||||
|
const struct SEE_object *object,
|
||||||
|
const struct SEE_objectclass *class);
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user