anchor.diff:      if value.GetType() = typeOf(String) then
         exit not String.IsNullOrEmpty(String(value));
     end;
  -
  -  // Arbitrary strings are converted to Double.NaN
  -  if (&type = typeOf(Double)) and (value.GetType() = typeOf(String)) then begin
  -    var lResult: Double;
  -    if Double.TryParse(String(value), out lResult) then
  -      exit lResult;
  -
  -    exit Double.NaN;
  -  end;
  -
  +{$ENDREGION}
  +
  +{$REGION Double }
  +  // Special-case Double conversions
  +  if &type = typeOf(Double) then begin
  +    // Arbitrary strings are converted to Double.NaN
  +    if value.GetType() = typeOf(String) then begin
  +      var lResult: Double;
  +      if Double.TryParse(String(value), out lResult) then
  +        exit lResult;
  +
  +      exit Double.NaN;
  +    end;
  +
  +    // Special rules for Boolean -> Double conversion (JS supports this)
  +    if value.GetType() = typeOf(Boolean) then
  +      exit iif(Boolean(value),1.0,0.0);
  +  end;
  +{$ENDREGION}
  +
  +{$REGION Int32, Int64, UInt32, UInt64}
  +  if &type in [ typeOf(Int32), typeOf(Int64), typeOf(UInt32), typeOf(UInt64) ] then begin
  +    // Convert String to Double first, and then to the target type
  +    if value.GetType() = typeOf(String) then begin
  +      var lResult: Double;
  +      if Double.TryParse(String(value), System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out lResult) then
  +        exit Convert.ChangeType(lResult, &type, System.Globalization.CultureInfo.InvariantCulture);
  +
  +      raise new FormatException('Cannot convert provided String value to an Integer value');
  +    end;
  +
  +    // Throw away fraction part
  +    if value.GetType() = typeOf(Double) then
  +      exit Convert.ChangeType(Math.Truncate(Double(value)), &type, System.Globalization.CultureInfo.InvariantCulture);
  +  end;
  +{$ENDREGION}
   
     exit Convert.ChangeType(value, &type, System.Globalization.CultureInfo.InvariantCulture);
   end;
  
positive.code:       if  (j = lParamStart)  then
          lReal[j] := Array.CreateInstance(lParams[lParams.Length-1].ParameterType.GetElementType, length(parameters) - lParamStart);
  
        Array(lReal[lParamStart]).SetValue(EcmaScriptObjectWrapper.ConvertTo(parameters[j], lParams[lParams.Length-1].ParameterType.GetElementType(), true), j - lParamStart);
      end
      else  begin
        lReal[j] := EcmaScriptObjectWrapper.ConvertTo(parameters[j], lParams[j].ParameterType, true);
      end;
    end;
  
  
negative.code:         exit  (false);
        end;
  
        FieldInfo(lItems[0]).SetValue(fValue, EcmaScriptObjectWrapper.ConvertTo(aValue.Value, FieldInfo(lItems[0]).FieldType));
  
        exit  (true);
      end;
  