You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASSERT_MESSAGE(args.Length() == 1, "long(x) should be called with single parameter");
83
-
ASSERT_MESSAGE(args[0]->IsString() || args[0]->IsStringObject() || args[0]->IsNumber() || args[0]->IsNumberObject(), "long(x) should be called with single parameter containing a long number representation");
84
-
85
82
auto isolate = Isolate::GetCurrent();
86
83
84
+
if (args.Length() != 1)
85
+
{
86
+
isolate->ThrowException(ConvertToV8String("long(x) should be called with single parameter"));
87
+
return;
88
+
}
89
+
if (!args[0]->IsString() && !args[0]->IsStringObject() && !args[0]->IsNumber() && !args[0]->IsNumberObject())
90
+
{
91
+
isolate->ThrowException(ConvertToV8String("long(x) should be called with single parameter containing a long number representation"));
ASSERT_MESSAGE(args.Length() == 1, "byte(x) should be called with single parameter");
113
-
ASSERT_MESSAGE(args[0]->IsString() || args[0]->IsStringObject() || args[0]->IsInt32() || args[0]->IsNumberObject(), "byte(x) should be called with single parameter containing a byte number representation");
114
-
115
120
auto isolate = Isolate::GetCurrent();
116
121
122
+
if (args.Length() != 1)
123
+
{
124
+
isolate->ThrowException(ConvertToV8String("byte(x) should be called with single parameter"));
125
+
return;
126
+
}
127
+
if (!args[0]->IsString() && !args[0]->IsStringObject() && !args[0]->IsNumber() && !args[0]->IsNumberObject())
128
+
{
129
+
isolate->ThrowException(ConvertToV8String("byte(x) should be called with single parameter containing a byte number representation"));
ASSERT_MESSAGE(args.Length() == 1, "short(x) should be called with single parameter");
143
-
ASSERT_MESSAGE(args[0]->IsString() || args[0]->IsStringObject() || args[0]->IsInt32() || args[0]->IsNumberObject(), "short(x) should be called with single parameter containing a short number representation");
144
-
145
158
auto isolate = Isolate::GetCurrent();
146
159
160
+
if (args.Length() != 1)
161
+
{
162
+
isolate->ThrowException(ConvertToV8String("short(x) should be called with single parameter"));
163
+
return;
164
+
}
165
+
if (!args[0]->IsString() && !args[0]->IsStringObject() && !args[0]->IsNumber() && !args[0]->IsNumberObject())
166
+
{
167
+
isolate->ThrowException(ConvertToV8String("short(x) should be called with single parameter containing a short number representation"));
168
+
return;
169
+
}
170
+
147
171
Local<Value> value;
148
172
if (args[0]->IsInt32())
149
173
{
@@ -169,13 +193,25 @@ void NumericCasts::MarkAsShortCallback(const v8::FunctionCallbackInfo<Value>& ar
0 commit comments