Reduce code smell -Remove setPrototype method in constructor/destructor. (#109)

https://sonarcloud.io/project/issues?id=pando-project_escargot&resolved=false&rules=cpp%3AS1699&severities=CRITICAL&sinceLeakPeriod=true&types=CODE_SMELL

Signed-off-by: Bence Gabor Kis <kisbg@inf.u-szeged.hu>
This commit is contained in:
kisbg 2019-03-04 12:25:32 +01:00 committed by yichoi
commit 02f462a481
14 changed files with 28 additions and 28 deletions

View file

@ -33,7 +33,7 @@ ArrayObject::ArrayObject(ExecutionState& state)
{
m_structure = state.context()->defaultStructureForArrayObject();
m_values[ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER] = Value(0);
setPrototype(state, state.context()->globalObject()->arrayPrototype());
Object::setPrototype(state, state.context()->globalObject()->arrayPrototype());
if (UNLIKELY(state.context()->vmInstance()->didSomePrototypeObjectDefineIndexedProperty())) {
ensureObjectRareData()->m_isFastModeArrayObject = false;
@ -415,7 +415,7 @@ ArrayIteratorObject::ArrayIteratorObject(ExecutionState& state, Object* a, Type
, m_iteratorNextIndex(0)
, m_type(type)
{
setPrototype(state, state.context()->globalObject()->arrayIteratorPrototype());
Object::setPrototype(state, state.context()->globalObject()->arrayIteratorPrototype());
}
void* ArrayIteratorObject::operator new(size_t size)