blob: eded624c36063318e5d53d578a2ae796b79678a9 [file] [log] [blame]
dsinclair8f3074b2016-06-02 17:45:25 -07001// Copyright 2016 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fxfa/parser/cxfa_valuearray.h"
8
Tom Sepez369fe1f2017-03-27 16:03:43 -07009#include <algorithm>
10
dsinclair31f87402016-07-20 06:34:45 -070011#include "xfa/fxfa/parser/cxfa_scriptcontext.h"
dsinclair8f3074b2016-06-02 17:45:25 -070012
13CXFA_ValueArray::CXFA_ValueArray(v8::Isolate* pIsolate)
14 : m_pIsolate(pIsolate) {}
15
Tom Sepez369fe1f2017-03-27 16:03:43 -070016CXFA_ValueArray::~CXFA_ValueArray() {}
dsinclair8f3074b2016-06-02 17:45:25 -070017
Tom Sepezf8a94392017-03-14 12:13:22 -070018std::vector<CXFA_Object*> CXFA_ValueArray::GetAttributeObject() {
Tom Sepez369fe1f2017-03-27 16:03:43 -070019 std::vector<CXFA_Object*> result(m_Values.size());
20 std::transform(m_Values.begin(), m_Values.end(), result.begin(),
21 [](const std::unique_ptr<CFXJSE_Value>& value) {
22 return CXFA_ScriptContext::ToObject(value.get(), nullptr);
23 });
24 return result;
dsinclair8f3074b2016-06-02 17:45:25 -070025}