1. implement Object.preventExtensions, Object.getPrototypeOf, Object.prototype.valueOf

2. Fix bug in Object::set
3. Fix bug in Object::defineOwnProperty
4. implement function Number correctly
5. set prototype of String, Number object correctly

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2016-12-22 17:12:16 +09:00
commit 3d16ed27df
6 changed files with 62 additions and 17 deletions

View file

@ -565,6 +565,8 @@ void GlobalObject::installString(ExecutionState& state)
m_stringPrototype = m_objectPrototype;
m_stringPrototype = new StringObject(state, String::emptyString);
m_stringPrototype->setPrototype(state, m_objectPrototype);
m_string->setFunctionPrototype(state, m_stringPrototype);
m_stringPrototype->defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().constructor), ObjectPropertyDescriptor(m_string));
m_stringPrototype->defineOwnPropertyThrowsException(state, ObjectPropertyName(state.context()->staticStrings().toString),
ObjectPropertyDescriptor(new FunctionObject(state, NativeFunctionInfo(state.context()->staticStrings().toString, builtinStringToString, 0, nullptr, NativeFunctionInfo::Strict)), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent)));