// Copyright 2018 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Flags: --allow-natives-syntax// Test variable index access to rest parameters// with up to 2 elements.(functiontestRestParametersVariableIndex(){functiong(...args){lets=0;for(leti=0;i<args.length;++i)s+=args[i];returns;}functionf(x,y){// (a) args[i] is dead code since args.length is 0.consta=g();// (b) args[i] always yields the first element.constb=g(x);// (c) args[i] can yield either x or y.constc=g(x,y);returna+b+c;}