13
13
14
14
namespace node {
15
15
16
- using errors::TryCatchScope;
17
-
18
16
using url::table_data::hex;
19
17
using url::table_data::C0_CONTROL_ENCODE_SET;
20
18
using url::table_data::FRAGMENT_ENCODE_SET;
@@ -32,7 +30,6 @@ using v8::Int32;
32
30
using v8::Integer;
33
31
using v8::Isolate;
34
32
using v8::Local;
35
- using v8::MaybeLocal;
36
33
using v8::NewStringType;
37
34
using v8::Null;
38
35
using v8::Object;
@@ -1925,48 +1922,6 @@ URL URL::FromFilePath(const std::string& file_path) {
1925
1922
return url;
1926
1923
}
1927
1924
1928
- // This function works by calling out to a JS function that creates and
1929
- // returns the JS URL object. Be mindful of the JS<->Native boundary
1930
- // crossing that is required.
1931
- MaybeLocal<Value> URL::ToObject (Environment* env) const {
1932
- Isolate* isolate = env->isolate ();
1933
- Local<Context> context = env->context ();
1934
- Context::Scope context_scope (context);
1935
-
1936
- const Local<Value> undef = Undefined (isolate);
1937
- const Local<Value> null = Null (isolate);
1938
-
1939
- if (context_.flags & URL_FLAGS_FAILED)
1940
- return Local<Value>();
1941
-
1942
- Local<Value> argv[] = {
1943
- undef,
1944
- undef,
1945
- undef,
1946
- undef,
1947
- null, // host defaults to null
1948
- null, // port defaults to null
1949
- undef,
1950
- null, // query defaults to null
1951
- null, // fragment defaults to null
1952
- };
1953
- SetArgs (env, argv, context_);
1954
-
1955
- MaybeLocal<Value> ret;
1956
- {
1957
- TryCatchScope try_catch (env, TryCatchScope::CatchMode::kFatal );
1958
-
1959
- // The SetURLConstructor method must have been called already to
1960
- // set the constructor function used below. SetURLConstructor is
1961
- // called automatically when the internal/url.js module is loaded
1962
- // during the internal/bootstrap/node.js processing.
1963
- ret = env->url_constructor_function ()
1964
- ->Call (env->context (), undef, arraysize (argv), argv);
1965
- }
1966
-
1967
- return ret;
1968
- }
1969
-
1970
1925
} // namespace url
1971
1926
} // namespace node
1972
1927
0 commit comments