diff --git a/DesktopEditor/doctrenderer/docbuilder.h b/DesktopEditor/doctrenderer/docbuilder.h index e84b9ba732..3201818a83 100644 --- a/DesktopEditor/doctrenderer/docbuilder.h +++ b/DesktopEditor/doctrenderer/docbuilder.h @@ -199,6 +199,11 @@ namespace NSDoctRenderer * Creates a null value. This method returns the current context and calls its CreateNull method. */ static CDocBuilderValue CreateNull(); + /** + * Please use CDocBuilderContext::CreateArray + * Creates an array. This method returns the current context and calls its CreateArray method. + */ + static CDocBuilderValue CreateArray(const int& length); public: /** diff --git a/DesktopEditor/doctrenderer/docbuilder_p.cpp b/DesktopEditor/doctrenderer/docbuilder_p.cpp index 0dd13975a5..038da31197 100644 --- a/DesktopEditor/doctrenderer/docbuilder_p.cpp +++ b/DesktopEditor/doctrenderer/docbuilder_p.cpp @@ -790,6 +790,14 @@ namespace NSDoctRenderer return ret; } + CDocBuilderValue CDocBuilderValue::CreateArray(const int& length) + { + CDocBuilderValue ret; + ret.m_internal->m_context = NSJSBase::CJSContext::GetCurrent(); + ret.m_internal->m_value = NSJSBase::CJSContext::createArray(length); + return ret; + } + // Functions CDocBuilderValue CDocBuilderValue::Call(const char* name) {