Implementing String.prototype.toString and String.prototype.valueOf built-in routines.

This commit is contained in:
Ruben Ayrapetyan
2014-09-25 21:04:13 +04:00
parent 5bee6cad0f
commit ba2eeb84af
3 changed files with 50 additions and 18 deletions
+7 -3
View File
@@ -14,7 +14,9 @@
*/
#include "ecma-alloc.h"
#include "ecma-builtins.h"
#include "ecma-exceptions.h"
#include "ecma-gc.h"
#include "ecma-globals.h"
#include "ecma-helpers.h"
#include "ecma-objects.h"
@@ -67,9 +69,11 @@ ecma_op_create_string_object (ecma_value_t *arguments_list_p, /**< list of argum
}
}
FIXME (/* Set to built-in String prototype (15.5.4) */);
ecma_object_t *obj_p = ecma_create_object (NULL, true, ECMA_OBJECT_TYPE_STRING);
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_STRING_PROTOTYPE);
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,
ECMA_OBJECT_TYPE_STRING);
ecma_deref_object (prototype_obj_p);
ecma_property_t *class_prop_p = ecma_create_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_CLASS);
class_prop_p->u.internal_property.value = ECMA_OBJECT_CLASS_STRING;