// Copyright 2016 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. #ifndef V8_URI_H_ #define V8_URI_H_ #include "src/allocation.h" #include "src/maybe-handles.h" #include "src/objects.h" namespace v8 { namespace internal { class Uri : public AllStatic { public: // ES6 section 18.2.6.2 decodeURI (encodedURI) static MaybeHandle DecodeUri(Isolate* isolate, Handle uri) { return Decode(isolate, uri, true); } // ES6 section 18.2.6.3 decodeURIComponent (encodedURIComponent) static MaybeHandle DecodeUriComponent(Isolate* isolate, Handle component) { return Decode(isolate, component, false); } // ES6 section 18.2.6.4 encodeURI (uri) static MaybeHandle EncodeUri(Isolate* isolate, Handle uri) { return Encode(isolate, uri, true); } // ES6 section 18.2.6.5 encodeURIComponenet (uriComponent) static MaybeHandle EncodeUriComponent(Isolate* isolate, Handle component) { return Encode(isolate, component, false); } // ES6 section B.2.1.1 escape (string) static MaybeHandle Escape(Isolate* isolate, Handle string); // ES6 section B.2.1.2 unescape (string) static MaybeHandle Unescape(Isolate* isolate, Handle string); private: static MaybeHandle Decode(Isolate* isolate, Handle uri, bool is_uri); static MaybeHandle Encode(Isolate* isolate, Handle uri, bool is_uri); }; } // namespace internal } // namespace v8 #endif // V8_URI_H_