SelfHostedIter.h (1078B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef frontend_SelfHostedIter_h 8 #define frontend_SelfHostedIter_h 9 10 namespace js::frontend { 11 12 // `for-of`, `for-await-of`, and spread operations are allowed on 13 // self-hosted JS code only when the operand is explicitly marked with 14 // `allowContentIter()`. 15 // 16 // This value is effectful only when emitting self-hosted JS code. 17 enum class SelfHostedIter { 18 // The operand is not marked. 19 // Also means "don't care" for non-self-hosted JS case. 20 Deny, 21 22 // The operand is marked. 23 AllowContent, 24 25 // The operand is marked and the `@@iterator` method is on the stack. 26 AllowContentWith, 27 28 // The operand is marked and the `next` method is on the stack. 29 AllowContentWithNext, 30 }; 31 32 } /* namespace js::frontend */ 33 34 #endif /* frontend_SelfHostedIter_h */